bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp(1) extended attributes bug


From: Ondřej Vašík
Subject: Re: cp(1) extended attributes bug
Date: Tue, 01 Sep 2009 08:16:28 +0200

Hi,
thanks for report...

Ernest N. Mamikonyan wrote:
> Cp(1) doesn't correctly copy extended attributes for read-only files:
> 
> touch foo
> setfattr -n user.key -v value foo
> chmod a-w foo
> cp --preserve=xattr foo bar
> cp: setting attribute `user.key' for `user.key': Permission denied

This error message is not produced by coreutils sources, but by libattr
- all messages about extended attributes are generated there. I'm not
sure why they are trying to set attributes for source file - maybe they
are not and access rights for destination file are more relevant.
Strace/ltrace of the failure could be helpful as well.

> If one uses "cp -a" instead, it simply strips the metadata and doesn't  
> complain.

cp -a shouldn't complain, but the xattrs are likely not preserved in
this case - just error message from xattr preservation is suppressed and
not preserving extended attributes is not considered as error in that
case.

Greetings,
         Ondřej Vašík

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy


reply via email to

[Prev in Thread] Current Thread [Next in Thread]