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,
and that you'd need either "cp --pres=owner,mode,timestamps,xattr" or
"cp --pres=all" on such systems? Doesn't sound much consistent ...

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?

Have a nice day,
Berny

Reply via email to