From: Paul Eggert Date: Sun, 25 Dec 2005 21:35:51 +0000 (+0000) Subject: chdir-safer cleanup X-Git-Tag: v6.0~1033 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=11eedd84d32ac1173b8ea68795a4f8cc73a3c114;p=thirdparty%2Fcoreutils.git chdir-safer cleanup --- diff --git a/lib/ChangeLog b/lib/ChangeLog index a26fa3e174..83d6f1fd1f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,21 @@ +2005-12-25 Paul Eggert + + * chdir-safer.h (FCHMOD_SAFER_H): Remove: it was misnamed, and + wasn't needed anyay. + * chdir-safer.c (chdir_no_follow): Don't include stdio.h, assert.h, + unistd.h, fcntl--.h; not needed. + (O_DIRECTORY): Define if not already defined. + (chdir_no_follow): Revamp describing comment to match code more + closely. Redo use of internal vars to avoid lint complaints. + Work even if directory is writeable but not readable. + Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that + don't have O_NOFOLLOW. Use O_NONBLOCK (POSIX spelling) rather + than O_NDELAY. Don't bother invoking fstat if open does not + dereference symlink, since the result isn't used then. + Don't assume file descriptor is positive; it might be zero + now that we no longer include fcntl--.h (we don't need fcntl--.h + since we immediately close the descriptor). + 2005-12-25 Jim Meyering * chdir-safer.c (chdir_no_follow): Remove unnecessary