GNU bug report logs -
#14972
cp docs should mention permissions result when destination already exists
Previous Next
Reported by: jidanni <at> jidanni.org
Date: Sun, 28 Jul 2013 03:32:02 UTC
Severity: normal
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Fellows, I don't think
(info "(coreutils) cp invocation")
mentions how
$ touch m
$ cp m n
$ chmod 444 m
$ cp m n #THESE LINES
$ cp m p #MAKE DIFFERENT THINGS
$ ls -l
-r--r--r-- 1 jidanni jidanni 0 07-28 11:20 m
-rw-r--r-- 1 jidanni jidanni 0 07-28 11:21 n
-r--r--r-- 1 jidanni jidanni 0 07-28 11:21 p
All we read is
In the absence of this option, each destination file is created
with the mode bits of the corresponding source file, minus the
bits set in the umask and minus the set-user-ID and set-group-ID
bits. *Note File permissions::.
So it says 'created', but doesn't mention what happens if the destination
already exists.
Yes I am deliberately not using -p here.
(This would also explain the mystery of how openssh-client: /usr/bin/scp works.)
$ cp --version
cp (GNU coreutils) 8.21
This bug report was last modified 11 years and 361 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.