From: "Chris PeBenito (pebenito)" <pebenito@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-projects commit in hardened/policycoreutils-extra/src: runscript_selinux.c
Date: Wed, 17 Sep 2008 03:16:08 +0000 [thread overview]
Message-ID: <E1KfnWS-0003nd-D4@stork.gentoo.org> (raw)
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);
reply other threads:[~2008-09-17 3:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1KfnWS-0003nd-D4@stork.gentoo.org \
--to=pebenito@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox