1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-05-31 06:46:37 +02:00
Commit Graph

4681 Commits

Author SHA1 Message Date
Jim Meyering f84dc6ccfc *** empty log message *** 2006-01-11 16:19:06 +00:00
Jim Meyering 614235c849 [!_LIBC]: Include "fcntl--.h", to map open to open_safer. 2006-01-11 16:18:39 +00:00
Jim Meyering dc9da6bde0 *** empty log message *** 2006-01-11 13:33:03 +00:00
Jim Meyering 0e42486491 (fchmodat, fchownat): Declare.
(chmodat, lchmodat): Define convenience functions.
(chownat, lchownat): Likewise.
2006-01-11 13:32:47 +00:00
Jim Meyering 9cbd6c0366 (fchownat): New function. 2006-01-11 13:32:03 +00:00
Jim Meyering c6749127ca (fchmodat): New file and function. 2006-01-11 13:30:31 +00:00
Jim Meyering 06df842f61 *** empty log message *** 2006-01-11 10:07:22 +00:00
Jim Meyering d1fe298155 (OP): Remove useless space-before-TAB. 2006-01-11 10:07:13 +00:00
Paul Eggert e06993903e Sync from gnulib. 2006-01-10 20:13:35 +00:00
Paul Eggert 388f158acf Update copyright year. 2006-01-10 20:05:53 +00:00
Paul Eggert 00eeaec5f2 Remove stray "lib/"s in previous change. 2006-01-10 20:01:34 +00:00
Paul Eggert d11af4159e Sync from gnulib. 2006-01-10 17:47:56 +00:00
Jim Meyering 71520b31c0 *** empty log message *** 2006-01-10 11:55:20 +00:00
Jim Meyering 58e925ce5f Avoid the double-free (first in fts_read, second in fts_close) that
would occur when an `active' directory is made inaccessible (e.g.,
via chmod a-x) during a traversal.

(fts_read): After a failed fchdir, update sp->fts_cur
before returning.  Reproduce this failure by
mkdir -p a/b; cd a; chmod a-x . b
Reported by Stavros Passas.
2006-01-10 11:55:13 +00:00
Jim Meyering e774de2be6 *** empty log message *** 2006-01-10 10:23:27 +00:00
Jim Meyering 0cb6f1cc82 fix typo in comment 2006-01-09 20:32:08 +00:00
Jim Meyering 00d069f7d9 *** empty log message *** 2006-01-06 16:48:27 +00:00
Jim Meyering ea20facd90 (COPYRIGHT_YEAR): Update to 2006. 2006-01-06 16:48:24 +00:00
Jim Meyering 084903a2b1 . 2006-01-04 21:06:39 +00:00
Paul Eggert 15954c3753 (tzname): Don't declare if it is already #defined. 2006-01-04 18:57:24 +00:00
Jim Meyering 0aea37a1b3 *** empty log message *** 2006-01-04 07:13:10 +00:00
Jim Meyering 27ab46340c Merge from glibc.
(fts_open): Avoid function call in MAX macro use.
2006-01-04 07:12:22 +00:00
Paul Eggert a2fa57b24c (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
long int, not int, for nanosecond counts, so that people who are
used to POSIX struct timespec won't be surprised.
2006-01-03 23:21:38 +00:00
Jim Meyering b9c62b6747 correct first-line comment 2006-01-03 10:29:58 +00:00
Paul Eggert c0dac69808 New approach to safer chmod. 2006-01-02 07:30:27 +00:00
Paul Eggert bee93bd060 No longer used. 2006-01-02 07:18:30 +00:00
Paul Eggert e59703a1d6 New file. 2006-01-02 06:34:32 +00:00
Paul Eggert c225633528 Include lchmod.h, lchmod.c.
(make_dir_parents): Use lchown rather than chown, and
lchmod rather than chmod.
2006-01-02 06:33:12 +00:00
Paul Eggert eb330d2584 chdir-related fixes 2005-12-27 08:00:42 +00:00
Paul Eggert 97fe820f88 (save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.
2005-12-27 07:57:14 +00:00
Paul Eggert ee7334652f (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
Fall back on chown if open failed with EACCES.
2005-12-27 07:56:33 +00:00
Paul Eggert 0d7468cabd (defined_S_IFMT): New macro.
Include stat-macros.h.
Include stdlib.h, for abort().
Don't include stdio.h or assert.h; no longer needed.
(same_file_type): Don't assume S_IFMT is defined, as POSIX
does not require this.  Don't assume S_IFCHR and S_IFBLK have
their usual sort of bit pattern.
(fchmod_new): Open with O_NOCTTY for as well, for minor
improvement on hosts where that matters.  Don't bother to assert,
since the caller (in this source file) checks the same thing.
Discard any errno from a close failure, for consistency with other
code.
2005-12-27 07:55:50 +00:00
Paul Eggert cc4d59e9cd (diropen): Don't bother trying to open directory for write access:
POSIX says that must fail.
2005-12-27 07:55:03 +00:00
Paul Eggert 8846a6bfdd (chdir_no_follow): Don't bother trying to open directory for write
access: POSIX says that must fail.
2005-12-27 07:54:37 +00:00
Paul Eggert a2c8ec26a4 (cdb_free): Don't bother trying to open directory
for write access: POSIX says that must fail.
(cdb_free): Open with O_NOCTTY | O_NONBLOCK as
well, for minor improvements on hosts that lack O_DIRECTORY.
2005-12-27 07:53:50 +00:00
Jim Meyering edf69af317 (chdir_no_follow): Move declaration of local,
sb2, `down' into the scope where it is used.
Note that on some systems this function also fails when DIR
is a writable-yet-unreadable directory.
2005-12-26 18:53:58 +00:00
Jim Meyering 078800a00b *** empty log message *** 2005-12-26 18:53:46 +00:00
Paul Eggert 7cffc5f20e chdir-safer.c still needs unistd.h 2005-12-25 21:40:01 +00:00
Paul Eggert f7a0d07623 Whoops; don't remove the include for unistd.h, since it defines fchdir. 2005-12-25 21:38:43 +00:00
Paul Eggert 11eedd84d3 chdir-safer cleanup 2005-12-25 21:35:51 +00:00
Paul Eggert 8b9f6b163a (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 21:35:38 +00:00
Paul Eggert 532cf2ac33 (FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay. 2005-12-25 21:35:21 +00:00
Jim Meyering 735fb62c0f *** empty log message *** 2005-12-25 17:34:04 +00:00
Jim Meyering d789e78a75 (chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode). 2005-12-25 17:33:57 +00:00
Jim Meyering 7916560259 *** empty log message *** 2005-12-23 18:15:38 +00:00
Jim Meyering 5d3118175f (make_dir_parents): Use chdir_no_follow only
if we've just created the directory.
2005-12-23 18:15:33 +00:00
Jim Meyering bdf801ef29 *** empty log message *** 2005-12-23 17:14:37 +00:00
Jim Meyering 7616f9171a *** empty log message *** 2005-12-23 12:00:37 +00:00
Jim Meyering 2eab9d93fc (chdir_no_follow): Rewrite to use fchdir even
when O_NOFOLLOW is not defined.  Suggested by Eric Blake.
2005-12-23 12:00:26 +00:00
Jim Meyering 867dbd1591 *** empty log message *** 2005-12-23 08:28:19 +00:00