This is the mail archive of the
mailing list for the Cygwin project.
Ash ntsec woes [was: Re: Postinstall failure: file not found]
Here is how sh behaves when executing a script with strange permissions
/> cat sayhi
/> getfacl sayhi
# file: sayhi
# owner: AdministratorS
# group: Users
/> sh -c sayhi <== OK
/> sh -c /sayhi <== Does not realize file is executable
/sayhi: not found
/> setfacl -s u::---,g::---,o:--- sayhi
/> sh -c sayhi <== Goes ahead even though file is unreadable
/> echo $?
The reason why ash is inconsistent is that when it searches
a command on PATH it does NOT check for executable or even
There is code that used to do that on line 558 of exec.c,
but it is "#ifdef notdef".
On the other hand, absolute paths are checked with stat on lines
459 and 472 (partly in Cygwin specific code).
So ash is always too permissive or too strict when looking up
commands, although its builtin "test" is fine.
The "just right" way in Cygwin is to use access(X_OK) on all
3 lines listed above.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html