bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] cp/mv: xattr support


From: Kamil Dudka
Subject: Re: [PATCH] cp/mv: xattr support
Date: Fri, 23 Jan 2009 12:44:30 +0100
User-agent: KMail/1.9.6 (enterprise 0.20071012.724442)

New version of patch is attached.

On Tuesday 20 January 2009 17:49:44 Pádraig Brady wrote:
> > On Tuesday 20 January 2009 11:36:20 Pádraig Brady wrote:
> >> If SELinux contexts and ACLs are implemented using xattrs,
> >> does --preserve=xattr copy these also, or does it just copy
> >> particular namespaces?  Worth clarifying in any case.
Yes, it does. It is now mentioned in coreutils.texi.

> >> Do we need a require_preserve_xattr?
> >> I.E. should all these be tristate instead of booleans?
> >
> > So you want cp to fail on attr_copy_{file,fd} fail with
> > option --preserve=xattr, but not with option --preserve=all? No problem I
> > think.
>
> Well I'm not sure. I think it should fail if you
> explicitly ask for xattr and it can't do it?
Now it fails if you explicitly ask for xattr and can't do it. If cp is built 
without xattr support, it fails even before file copying.

> >>> diff --git a/tests/misc/xattr b/tests/misc/xattr
> >>> new file mode 100755
> >>> index 0000000..2f50134
> >>> --- /dev/null
> >>> +++ b/tests/misc/xattr
> >>> @@ -0,0 +1,80 @@
> >>> +#!/bin/sh
> >>> +# Ensure that cp --preserve=xattr and mv preserve extended attributes.
> >>
> >> we should add a test for `install` to ensure/make obvious
> >> it doesn't preserve xattrs.
Ok, added test for install.

> >>> +# Skip this test if cp was built without xattr support:
> >>> +grep '^#define USE_XATTR 1' $CONFIG_HEADER > /dev/null ||
> >>> +  skip_test_ "coreutils built without xattr support"
> >>
> >> I'd rather test a binary as it's little less coupled I think:
> >>
> >> cp --preserve=xattr --help >/dev/null 2>&1 ||
> >>   skip_test_ "coreutils built without xattr support"
Slightly changed to use cp -n instead of cp --help as --help always returns 
EXIT_SUCCESS.


Kamil

Attachment: 0001-cp-mv-add-xattr-support.patch
Description: Text Data


reply via email to

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