This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cannot exec() program outside of /bin if PATH is unset

On Fri, Sep 12, 2014 at 9:33 PM, Eric Blake  wrote:
> On 09/12/2014 11:02 AM, Christian Franke wrote:
>> int main()
>> {
>>   unsetenv("PATH");
> This is undefined behavior, per POSIX.  POSIX recommends that you always
> leave PATH defined to at least a bare minimum of the results of
> confstr(_CS_PATH, ...); it also states that implementations are free to
> do what they want (in this case, crash) if you don't follow the
> recommendation:
> "If PATH is unset or is set to null, the path search is
> implementation-defined."

Nitpick: undefined != implementation-defined

GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]