Re: purpose of *-safer?

2006-07-26 Thread Bruno Haible
Eric Blake wrote: POSIX requires [n]- and [n]- redirection operators to close the respective stream, even when n is 0, 1, or 2. POSIX allows an implementation to supply replacement file descriptors when exec'ing a setuid or setgid program. But in the normal case, implementations really do

Re: purpose of *-safer?

2006-07-26 Thread Jim Meyering
Bruno Haible [EMAIL PROTECTED] wrote: Eric Blake wrote: POSIX requires [n]- and [n]- redirection operators to close the respective stream, even when n is 0, 1, or 2. POSIX allows an implementation to supply replacement file descriptors when exec'ing a setuid or setgid program. But in the

Re: [bug-gnulib] purpose of *-safer?

2006-07-26 Thread Bruno Haible
Jim Meyering wrote: Don't ever hide a conceptual write failure. Reporting the error is the desired behavior. Thanks for explaining. Another argument, maybe, is that the kernel people wouldn't have invented /dev/null if you could get the same effect by closing the file descriptor. It all makes

Re: purpose of *-safer?

2006-07-25 Thread Bruno Haible
Hi Paul, When is it recommended to use these *-safer modules? What I understand is: If one of the file descriptors 0, 1, 2 is closed at program startup, and if you later use open() or fopen(), it might be possible that printf or fprintf statements to stdout or stderr are directed into this

Re: purpose of *-safer?

2006-07-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 7/25/2006 2:05 PM: Hi Paul, When is it recommended to use these *-safer modules? What I understand is: If one of the file descriptors 0, 1, 2 is closed at program startup, and if you later use open() or fopen(), it