Security context, how to change?

Stephen Smalley sds at tycho.nsa.gov
Thu Oct 13 13:07:45 UTC 2005


On Thu, 2005-10-13 at 07:42 +0200, Tomas Larsson wrote:
> How do I change the security context automatically.
> I.e if I am moving one file from one folder, is it possible to automatically
> to
> Put the context for the new directory on the file.
> For example, if I move a file from the FTP-upload folder to HTTPD download
> folder.

If the file was just renamed (intra-filesystem mv), then you can run
restorecon on the file to reset its file context to the default for its
location.  If the file was copied, the new copy should inherit the
directory context automatically unless a) policy defines a type
transition, or b) you used the option to preserve security contexts on
the copy.

-- 
Stephen Smalley
National Security Agency




More information about the fedora-selinux-list mailing list