[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cp: when are ACLs copied?
From: |
Pádraig Brady |
Subject: |
Re: cp: when are ACLs copied? |
Date: |
Fri, 23 Nov 2012 09:22:55 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
On 11/23/2012 09:02 AM, Bernhard Voelker wrote:
As far as I understand the texi documentation, "cp -p" and "cp --preserve"
copy the ACLs (because they belong to the 'mode' which is included in the
default 'mode,owner,timestamps'):
‘mode’
Preserve the file mode bits and access control lists.
But reading further, this becomes unclear again:
‘xattr’
Preserve extended attributes of the file, or fail with full diagnostics.
If cp is built without xattr support, ignore this option. If SELinux context,
ACLs or Capabilities are implemented using xattrs, they are preserved by this
option as well.
Does that mean, that ACLs are not copied with "cp -p" on SELinux systems,
no...
and that you'd need either "cp --pres=owner,mode,timestamps,xattr" or
"cp --pres=all" on such systems? Doesn't sound much consistent ...
It means that since xattrs are often used to store ACLs, SELinux contexts
and capabilities etc., by specifying --preserve=xattr you may be implicitly
copying those, even if you didn't specify --preserve=mode or --preserve=context
And finally, what does the condition "If SELinux context" mean exactly?
a) if SELinux support is compiled into cp, or
b) if the system has SELinux enabled?
c) There are SElinux xattrs present.
thanks,
Pádraig.