Hi,

        My previous patch to turn on SELinux support exposed a bug in
 cron's SELinux code: it SEGV's on startup.

        The following patch relative to the previous patch would fix
 things: 
=============================================================================
--- user.c.orig 2005-07-02 23:06:07.205197023 +1000
+++ user.c      2005-07-02 23:06:18.570084582 +1000
@@ -41,7 +41,7 @@
     struct av_decision avd;
     int retval=0;
 
-    rcontext = NULL;
+    *rcontext = NULL;
     if (get_default_context(name, NULL, &scontext)) {
         if (security_getenforce() > 0) {
             log_it(name, getpid(), "No SELinux security context", tabname);

==================================================================================

        I am attaching a consolidated patch that includes the changfes
 in the previous patch, as well as the fix above, in the attachment
 below.

        manoj

diff -uBbwr cron-3.0pl1/debian/control cron-3.0pl1.selinux/debian/control
--- cron-3.0pl1/debian/control	2005-06-23 00:32:58.000000000 -0500
+++ cron-3.0pl1.selinux/debian/control	2005-06-23 00:47:38.000000000 -0500
@@ -3,7 +3,7 @@
 Priority: important
 Maintainer: Steve Greenland <[EMAIL PROTECTED]>
 Standards-Version: 3.6.1
-Build-Depends: debhelper, libpam0g-dev, libselinux1-dev
+Build-Depends: debhelper, libpam0g-dev, libselinux1-dev [!hurd-i386]
 
 Package: cron
 Architecture: any
diff -uBbwr cron-3.0pl1/debian/rules cron-3.0pl1.selinux/debian/rules
--- cron-3.0pl1/debian/rules	2005-06-23 00:32:58.000000000 -0500
+++ cron-3.0pl1.selinux/debian/rules	2005-06-23 01:09:31.000000000 -0500
@@ -18,13 +18,6 @@
   DEB_INSTALL += -s
 endif
 
-# SELinux
-ifeq (yes,$(SELINUX))
-  SELINUX_DEFS = -DWITH_SELINUX
-  SELINUX_LIBS = -lselinux
-endif
-
-export SELINUX_DEFS SELINUX_LIBS
 
 # Set system type (Linux, HURD, etc.)
 DEB_HOST_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
@@ -36,11 +29,19 @@
   PAM_DEFS = -DUSE_PAM
   PAM_LIBS = -lpam
   CONFFILES = conffiles.pam
+  SELINUX = yes
 endif
 
 export PAM_DEFS
 export PAM_LIBS
 
+# SELinux
+ifeq (yes,$(SELINUX))
+  SELINUX_DEFS = -DWITH_SELINUX
+  SELINUX_LIBS = -lselinux
+endif
+
+export SELINUX_DEFS SELINUX_LIBS
 
 build: build-cron build-cron-se
 
diff -uBbwr cron-3.0pl1/user.c cron-3.0pl1.selinux/user.c
--- cron-3.0pl1/user.c	2005-06-23 00:32:57.000000000 -0500
+++ cron-3.0pl1.selinux/user.c	2005-07-04 19:14:39.000000000 -0500
@@ -41,7 +41,7 @@
     struct av_decision avd;
     int retval=0;
 
-    rcontext = NULL;
+    *rcontext = NULL;
     if (get_default_context(name, NULL, &scontext)) {
         if (security_getenforce() > 0) {
             log_it(name, getpid(), "No SELinux security context", tabname);
-- 
Possessions increase to fill the space available for their
storage. Ryan
Manoj Srivastava   <[EMAIL PROTECTED]>  <http://www.debian.org/%7Esrivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

Reply via email to