From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luke Kenneth Casson Leighton Date: Thu, 26 Aug 2004 22:56:28 +0000 Subject: Re: Cleaned up udev-selinux patch Message-Id: <20040826230221.GE6058@lkcl.net> List-Id: References: <20040223213614.GA12242@devserv.devel.redhat.com> <20040224233859.GA3265@kroah.com> <20040224234652.GA14775@devserv.devel.redhat.com> <403C8AE4.10403@redhat.com> <20040228005300.GA13860@kroah.com> <412DFE7B.6060409@redhat.com> <20040826155716.GA30726@kroah.com> <412E20AF.7000102@redhat.com> In-Reply-To: <412E20AF.7000102@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Daniel J Walsh Cc: Greg KH , Bill Nottingham , harald@redhat.com, SELinux , "Fedora SELinux support list for users & developers." , linux-hotplug-devel@lists.sourceforge.net On Thu, Aug 26, 2004 at 01:41:03PM -0400, Daniel J Walsh wrote: like this: --- /dev/null 2004-06-21 15:29:38.000000000 -0400 +++ udev-030/selinux.h 2004-08-26 13:14:05.730808665 -0400 @@ -0,0 +1,87 @@ +#ifndef SELINUX_H +#define SELINUX_H + +#ifndef USE_SELINUX +#define set_selinux_set_context(file, mode) do { } while (0) +#define selinux_setup_context(file, mode) do { } while (0) +#define selinux_init() do { } while (0) +#define selinux_restore() do { } while (0) + +#else + +#define set_selinux_set_context real_set_selinux_context +#define set_selinux_setup_context real_set_setup_context +... --- /dev/null 2004-06-21 15:29:38.000000000 -0400 +++ udev-030/selinux.c 2004-08-26 13:14:05.730808665 -0400 +#include + +static int selinux_enabled=-1; +static security_context_t prev_scontext=NULL; + +#undef is_selinux_running +static inline int is_selinux_running(void) { + if ( selinux_enabled=-1 ) + return selinux_enabled=is_selinux_enabled()>0; + return selinux_enabled; +} +#undef selinux_set_context +void real_selinux_set_context(char *file, unsigned int mode) { ^^^^ ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ 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