Eric Blake [ebl...@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