diff options
author | Jim Meyering <meyering@redhat.com> | 2007-11-16 09:31:15 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2007-11-22 00:19:06 +0100 |
commit | 2bdc48121916ab0d7bb7d0cb5cee25549c3705c9 (patch) | |
tree | 8a808a3c99c29aa7f5e958f7bac4f274f8eb753c /src/install.c | |
parent | fa636dcf6a298a4935ba950d433c33a07d0f8504 (diff) | |
download | coreutils-2bdc48121916ab0d7bb7d0cb5cee25549c3705c9.tar.gz coreutils-2bdc48121916ab0d7bb7d0cb5cee25549c3705c9.tar.bz2 coreutils-2bdc48121916ab0d7bb7d0cb5cee25549c3705c9.zip |
cp: by default, refuse to copy through a dangling destination symlink
* NEWS: Mention this change.
* doc/coreutils.texi (cp invocation): Describe the new behavior.
* src/copy.c: No longer include "canonicalize.h".
(copy_reg): Upon failure to open a dangling destination symlink, don't
canonicalize the name, but rather fail (default) or, with POSIXLY_CORRECT,
repeat the open call without O_EXCL (potentially dangerous).
* src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
New member. Reorder the others, grouping "bool" and "enum"
members together.
* tests/cp/thru-dangling: Test for changed and new behavior.
* src/cp.c (cp_option_init): Initialize new member.
* src/install.c (cp_option_init): Likewise.
* src/mv.c (cp_option_init): Likewise.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Diffstat (limited to 'src/install.c')
-rw-r--r-- | src/install.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/install.c b/src/install.c index 8e4875844..802dfcf77 100644 --- a/src/install.c +++ b/src/install.c @@ -190,6 +190,7 @@ cp_option_init (struct cp_options *x) x->mode = S_IRUSR | S_IWUSR; x->stdin_tty = false; + x->open_dangling_dest_symlink = false; x->update = false; x->preserve_security_context = false; x->verbose = false; |