Does SELinux-enabled mkdir *really* need --context=CTX (aka -Z CTX)?

Bruno Wolff III bruno at wolff.to
Fri Aug 18 14:44:04 UTC 2006


On Fri, Aug 18, 2006 at 15:23:18 +0200,
  Jim Meyering <meyering at redhat.com> wrote:
>   At first, when I saw that the SELinux-enabled cp provides a new
>   --context=CTX option, I figured mv should have the same one, since
>   mv sometimes needs to perform a copy.  But a better way to look at
>   that is to wonder if cp really needs the option.  It's for _copying_
>   after all: preserving, not changing permissions or SELinux "labels".
>   When I raised the issue on the SELinux mailing list, most agreed that
>   neither mv nor cp need that option.  Of course, regardless of whether
>   there are new options, mv should always attempt to preserve any existing
>   SELinux context, and cp should be able to do so, too.

Note that cp doesn't copy (group) ownership and permissions (unmask is
applied) by default. It may make sense to let --preserve and -p control
whether the original context is copied over.




More information about the fedora-list mailing list