Overview
| Artifact ID: | e704995854671aca6c8277ada84e3504f4e50370f9b4e7d96c1fb5bcea7ca45e |
|---|---|
| Ticket: | e2698b94b151aecf275b3dd2c5d605b89022684e
Tcl_FSChdir crashes after seteuid |
| User & Date: | apnadkarni on 2026-04-16 05:47:20 |
Changes
- icomment:
I could not reproduce this on Ubuntu 22 but that could very well be because I'm running under WSL and behavior of getcwd() etc. on NTFS could very well be different as far as access permissions go. In fact, the test suite already disables chmod related tests for WSL. Looking at the source code, it appears the recursion case happens [here](https://core.tcl-lang.org/tcl/file?ci=b6a50a0482cf3db3&name=generic%2FtclPathObj.c&ln=1869) where the path value is "". How it gets to be the empty string is a question but I suspect somewhere getcwd returns NULL on error and that gets translated to the empty string. That's just conjecture. The comment there ``` * Special handling for the empty string value. This one is very * weird with [file normalize {}] => {}. (The reasoning supporting * this is unknown to DGP, but he fears changing it.) Attempt here * to keep the expectations of other parts of Tcl_Filesystem code * about state of the FsPath fields satisfied. ``` is rather telling but I'm in the same boat as DGP in that regard. If @jmr or someone running macos can trace and check if the path is in fact "" at that point, it would help track this down. - login: "apnadkarni"
- mimetype: "text/x-markdown"