Skip to contentSkip to conversation

cp: --preserve={context,xattr,acl}

DISCUSSION Jim Meyering 2 participants 2 messages Aug 18, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

Currently, upstream cp can selectively preserve a few different attributes.

Quoted 1 line

From the documentation:

`-p'
`--preserve[=ATTRIBUTE_LIST]'
Preserve the specified attributes of the original files. If specified, the ATTRIBUTE_LIST must be a comma-separated list of one or more of the following strings:

`mode' ...
`ownership'
`timestamps'
`links'
`all'

Using --preserve' with no ATTRIBUTE_LIST is equivalent to --preserve=mode,ownership,timestamps'.

In the absence of this option, each destination file is created with the permissions of the corresponding source file, minus the bits set in the umask and minus the set-user-ID and set-group-ID bits. *Note File permissions::.

The SELinux patches add "context" to the list.
and upstream treats ACLs like "mode".

However, with XATTR support, I may well add two more: "xattr" and "acl".

But then there'd be overlap between --preserve=xattr and --preserve=context, Since I presume the latter subsumes the former. Right?

So if both were specified on a selinux-enabled system, would there be any point in doing anything XATTR-specific?

What do you think?

Jim

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 2 lines · Jim Meyering

Currently, upstream cp can selectively preserve a few different attributes. From the documentation:

[...]

Quoted 10 lines

The SELinux patches add "context" to the list.
and upstream treats ACLs like "mode".

However, with XATTR support, I may well add two more: "xattr" and "acl".

But then there'd be overlap between --preserve=xattr and --preserve=context, Since I presume the latter subsumes the former. Right?

So if both were specified on a selinux-enabled system, would there be any point in doing anything XATTR-specific?

With tar I had xattr imply acl and selinux, but then they could be used
individually like: --preserve=xattrs --no-preserve=selinux (does generic user xattrs and acls, but not selinux context).
Although the tar patches haven't been accepted upstream yet (they are
just before a stable release, so aren't accepting features).

Signature · 1 line
James Antill <[email protected]>