Deleting file contexts

Stephen Smalley sds at
Mon Jun 27 12:59:26 UTC 2005

On Fri, 2005-06-24 at 09:42 -0500, Robert Nichols wrote:
> I'm running with selinux=0 and would like to delete the no longer
> updated security contexts from my file systems.  Is there a way to
> do that short of mke2fs + restore from backup?

find / -exec setfattr -x security.selinux {} \;

You might want to further qualify the find statement to avoid noise on
filesystems that don't support security contexts, e.g.
find / \( -fstype ext2 -o -fstype ext3 -o -fstype jfs -o -fstype xfs \)
-exec setfattr -x security.selinux {} \;

Stephen Smalley
National Security Agency

More information about the fedora-selinux-list mailing list