GNU bug report logs - #6245
cp - copy files and directories, ls -Rld, chmod

Previous Next

Package: coreutils;

Reported by: "estonoeshawaii <at> yahoo.com" <estonoeshawaii <at> yahoo.com>

Date: Sat, 22 May 2010 07:27:01 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 6245 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: 6245 <at> debbugs.gnu.org, bob <at> proulx.com
Subject: Re: bug#6245: cp - copy files and directories, ls -Rld, chmod
Date: Sun, 23 May 2010 00:47:00 +0100
On 22/05/10 20:34, Bob Proulx wrote:
> estonoeshawaii <at> yahoo.com 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.




This bug report was last modified 15 years and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.