From: Russell Coker Date: Fri, 06 Aug 2004 12:05:08 +0000 Subject: Re: matchfilecon (the program) vs matchfilecon (the libselinux1 fn) Message-Id: <200408062205.08533.russell@coker.com.au> List-Id: References: <20040801172751.GD20103@lkcl.net> <1091474356.23449.272.camel@moss-spartans.epoch.ncsc.mil> <20040802211212.GB6260@lkcl.net> In-Reply-To: <20040802211212.GB6260@lkcl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Luke Kenneth Casson Leighton Cc: Stephen Smalley , SE-Linux , Daniel J Walsh , Linux Hotplug Dev List On Tue, 3 Aug 2004 07:12, Luke Kenneth Casson Leighton wrote: > p.s. first cut at mods attached for general review NO I HAVEN'T > COMPILED IT. One thing to note is that is_selinux_enabled() reads /proc/filesystems and then reads /proc/self/attr/current. This is more work than you want to do for every device node. So you want to cache the result of is_selinux_enabled() to some degree. You certainly don't want to call it twice in the same code path. udev is tricky in this regard because there is the possibility that udev may be started before SE Linux is enabled. Maybe the best thing to do would be to check for SE Linux being enabled once for each group of new devices that you add, and only once for the system startup. -- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel