diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2007-03-25 09:52:57 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-03-25 09:52:57 +0200 |
commit | 1efda4faf3878d180a13a94cadc690f2a95090b1 (patch) | |
tree | eccdf744921edfb7b4eea958a2fd2c76e26af4be /lib/search_.h | |
parent | de730249777c65b2c75502b00159400eda8dacf9 (diff) | |
download | coreutils-1efda4faf3878d180a13a94cadc690f2a95090b1.tar.xz |
Avoid the need for euidaccess and/or lstat on every directory entry
with 'rm -r dir' (without -f), if we are root, or if we are removing
a directory tree that is full of symbolic links.
* bootstrap.conf (gnulib_modules): Add write-any-file.
* src/copy.c: Include write-any-file.h.
(UNWRITABLE): Remove macro, replacing with....
(writable_destination): New function, which uses can_write_any_file
to avoid the need for euidaccess when we are privileged.
(overwrite_prompt, abandon_move): Use it.
* src/remove.c: Include write-any-file.h.
(D_TYPE): New macro.
(DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
(write_protected_non_symlink): Don't bother to stat if we can write
any file.
(prompt): New arg PDIRENT_TYPE. All callers changed.
Use readdir dirent type to avoid the need for 'lstat' on each directory
entry in cases like 'rm -r dir', if we are root, or if the tree is
full of symbolic links.
(DT_IS_KNOWN, DT_MUST_BE): Remove.
(remove_entry): New arg DIRENT_TYPE_ARG. All callers changed.
Diffstat (limited to 'lib/search_.h')
0 files changed, 0 insertions, 0 deletions