public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-projects commit in hardened/policycoreutils-extra/src: runscript_selinux.c
@ 2008-09-17  3:16 Chris PeBenito (pebenito)
  0 siblings, 0 replies; only message in thread
From: Chris PeBenito (pebenito) @ 2008-09-17  3:16 UTC (permalink / raw
  To: gentoo-commits

pebenito    08/09/17 03:16:08

  Modified:             runscript_selinux.c
  Log:
  handle slightly different is_selinux_enabled() behavior in libselinux 2.0.

Revision  Changes    Path
1.17                 hardened/policycoreutils-extra/src/runscript_selinux.c

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/hardened/policycoreutils-extra/src/runscript_selinux.c?rev=1.17&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/hardened/policycoreutils-extra/src/runscript_selinux.c?rev=1.17&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/hardened/policycoreutils-extra/src/runscript_selinux.c?r1=1.16&r2=1.17

Index: runscript_selinux.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/hardened/policycoreutils-extra/src/runscript_selinux.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- runscript_selinux.c	10 Mar 2006 21:28:58 -0000	1.16
+++ runscript_selinux.c	17 Sep 2008 03:16:07 -0000	1.17
@@ -1,6 +1,6 @@
 /*
  * Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/hardened/policycoreutils-extra/src/runscript_selinux.c,v 1.16 2006/03/10 21:28:58 pebenito Exp $
+ * $Header: /var/cvsroot/gentoo-projects/hardened/policycoreutils-extra/src/runscript_selinux.c,v 1.17 2008/09/17 03:16:07 pebenito Exp $
  */
 
 /*
@@ -46,6 +46,7 @@
 #include <fcntl.h>
 #include <ctype.h>
 #include <limits.h>
+#include <errno.h>
 #ifdef USE_AUDIT
 #include <libaudit.h>
 #endif
@@ -348,13 +349,22 @@
  /*
   * Get our current context.
   */
-  if ( getcon(&curr_context) == 0 ) {
+  if ( getcon(&curr_context) < 0 ) {
+    if( errno == ENOENT ) {
+      /* should only hit this if proc is not mounted.  this
+       * happens on Gentoo right after init starts, when
+       * the init script processing starts.
+       */
+      return;
+    } else {
+      perror("runscript_selinux.c: getcon()");
+      exit(1);
+    }
+  }
+
 #ifdef CANTSPELLGDB
-    printf("current context is %s\n", curr_context);
+  printf("current context is %s\n", curr_context);
 #endif
-  } else {
-    exit(1);
-  }
 
   /* extract the type from the context */
   curr_con=context_new(curr_context);






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-17  3:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-17  3:16 [gentoo-commits] gentoo-projects commit in hardened/policycoreutils-extra/src: runscript_selinux.c Chris PeBenito (pebenito)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox