--- Begin Message ---
Subject: |
cp docs should mention permissions result when destination already exists |
Date: |
Sun, 28 Jul 2013 11:31:12 +0800 |
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
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#14972: cp docs should mention permissions result when destination already exists |
Date: |
Sun, 28 Jul 2013 10:50:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Better to be explicit I suppose.
How about:
-In the absence of this option, each destination file is created with the
+In the absence of this option, the permissions of existing destination
+files are unchanged, while each new 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.
@xref{File permissions}.
thanks,
Pádraig.
--- End Message ---