[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6245: cp - copy files and directories, ls -Rld, chmod
From: |
Pádraig Brady |
Subject: |
bug#6245: cp - copy files and directories, ls -Rld, chmod |
Date: |
Sun, 23 May 2010 00:47:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 22/05/10 20:34, Bob Proulx wrote:
> address@hidden wrote:
>> course), because It does not preserve ownership (except if you are
>> root) . The problem is that it doesn't tell you anything when it
>> doesn't do it or that It shouldn't be supposed to preserve
>> ownership.
>
> This is related to this FAQ entry. It explains why only root can
> chown files.
>
>
> http://www.gnu.org/software/coreutils/faq/#Why-can-only-root-chown-files_003f
>
> The 'cp -a' option says:
>
> `-a'
> `--archive'
> Preserve as much as possible of the structure and attributes of the
> original files in the copy ...
>
> It is not possible to preserve the ownership of a file unless you are
> root. Therefore cp is preserving "as much as possible".
I noticed myself that `cp --preserve=owner` does not give an
error when running as non root. A pertinent comment from the source:
/* If non-root uses -p, it's ok if we can't preserve ownership.
But root probably wants to know, e.g. if NFS disallows it,
or if the target system doesn't support file ownership. */
Perhaps if "owner" is explicitly specified they we should warn?
I'm not sure it's worth diverging the warning characteristics
for this though.
cheers,
Pádraig.