Re: [PATCH 1/1] selinux: add support for installing a dummy policy

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Serge E. Hallyn <serue@...>
Cc: James Morris <jmorris@...>, lkml <linux-kernel@...>, SELinux <selinux@...>, David P. Quigley <dpquigl@...>
Date: Monday, August 25, 2008 - 8:10 am

On Fri, 2008-08-22 at 21:38 -0500, Serge E. Hallyn wrote:

/sbin/setfiles on modern Fedora releases.


Save version to a variable and reuse below.


ext4, ext4dev, gfs2 too.
See /sbin/fixfiles for an example.  Or run it.


You can pass them all to setfiles at once; it takes a list of mount
points after the file_contexts file. Or run fixfiles instead as it does
much the same.

However, I don't believe this step will work if you are doing this on an
existing SELinux-enabled system - the kernel will check the contexts
upon setxattr against the active policy and reject them, and you haven't
loaded the new policy yet.  Also, this is a "destructive" operation,
i.e. if they were running SELinux before, they are hereby clobbering all
their file labels.  Possibly you should bail out if selinuxenabled
(utility that can be used as a boolean in shell conditionals).
if /usr/sbin/selinuxenabled; then
	echo"SELinux already enabled with a policy loaded; exiting."
	exit 1
fi


Not sure what you are doing here.  If /dev is udev-managed, then it will
handle labeling at boot.  But it still shows up as a tmpfs mount
in /proc/self/mounts.

Where do you set up /etc/selinux/config to refer to this dummy policy so
it will get loaded at boot?

-- 
Stephen Smalley
National Security Agency

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/1] selinux: add support for installing a dummy ..., David P. Quigley, (Mon Aug 25, 10:56 am)
Re: [PATCH 1/1] selinux: add support for installing a dummy ..., David P. Quigley, (Tue Aug 26, 11:54 am)
Re: [PATCH 1/1] selinux: add support for installing a dummy ..., Stephen Smalley, (Mon Aug 25, 8:10 am)