GNU bug report logs - #8767
cp: --preserve=all doesn't work for the parents when --parent is used

Previous Next

Package: coreutils;

Reported by: Christoph Anton Mitterer <calestyo <at> scientia.net>

Date: Mon, 30 May 2011 22:50:03 UTC

Severity: normal

Tags: moreinfo

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Ondrej Vasik <ovasik <at> redhat.com>
To: Christoph Anton Mitterer <calestyo <at> scientia.net>
Cc: 8767 <at> debbugs.gnu.org
Subject: Re: bug#8767: cp: --preserve=all doesn't work for the parents when
	--parent is used
Date: Tue, 31 May 2011 16:41:53 +0200
On Tue, 2011-05-31 at 15:20 +0200, Christoph Anton Mitterer wrote:
> On Tue, 2011-05-31 at 09:42 +0200, Ondrej Vasik wrote:
> > Could you please specify coreutils version where you experience the
> > issue?
> Sorry, forgot that.
> This was the corutils from Debian sid, which is currently 8.5.

Thanks for specifying that ... current version is 8.12, but I think the
support in 8.5 was ready enough.

> > but in the case of extended attributes and
> > SELinux context possible failure of preserving these attributes doesn't
> > change exit status.
> Oh that's bad,.. why?

Because preserve=all and -a is too general and some filesystems might
not have support for it. Therefore failure might break old scripts.
Failures might be quite wordy, in addition. So cp -a / cp
--preserve=all /mv just tries to preserve as much as possible.

http://lists.gnu.org/archive/html/bug-coreutils/2009-04/msg00174.html
http://lists.gnu.org/archive/html/bug-coreutils/2010-03/msg00268.html
http://lists.gnu.org/archive/html/bug-coreutils/2010-04/msg00039.html

When you explicitly mention the attribute, you probably really want it,
so failure changes the exit status.

> Can I get this behavious by using --preserve=context,xattr,all to REALLY
> preserve everything and get errors if this didn't work.

Yes, preserve=context,xattr,all should make these attributes required.

> > please try if using --preserve=xattr
> > shows an error.
> I did, but no error, no preservation.
> Also it's on the same filesystem (with user_xattr enabled,.. so there
> should be no problem).

Ok, so it should not be caused by filesystem... could you please check
the strace of the cp for (f/l)getxattr?

Greetings,
         Ondrej





This bug report was last modified 6 years and 284 days ago.

Previous Next


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