bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash: Correct usage of F_SETFD


From: Sukadev Bhattiprolu
Subject: Re: bash: Correct usage of F_SETFD
Date: Tue, 23 Nov 2010 09:51:57 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

Eric Blake [eblake@redhat.com] wrote:
| > 
| > So if bash is the one creating its file descriptors, there's no need to
| > use R/M/W since it knows what the state of them are.
| 
| No, bash cannot reasonably know what the implementation's default bit
| state is, and blindly setting all other bits to zero is very possibly a
| bug, and easy enough to avoid by using the full R/M/W.

Besides, if user sets a flag on the fd and execs bash, bash would clobber
the flag. IOW, assuming that bash is the one creating the fd is not always
safe right ?

Thanks,

Sukadev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]