All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Jonathan Kim <jkim@TrustedCS.com>,
	SELinux@tycho.nsa.gov, Chad Hanson <chanson@TrustedCS.com>
Subject: Re: [ SEMANAGE] Resync seuser parser
Date: Fri, 04 Nov 2005 09:35:51 -0500	[thread overview]
Message-ID: <436B71C7.700@cornell.edu> (raw)
In-Reply-To: <1131112032.23420.210.camel@moss-spartans.epoch.ncsc.mil>

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]


> I don't see why it is needed; it seems like one would omit the separator
> as well if no level was being specified.
>   



[-- Attachment #2: libselinux.missing_colon.diff --]
[-- Type: text/x-patch, Size: 1268 bytes --]

diff -Naurp --exclude CVS --exclude ChangeLog --exclude VERSION --exclude Makefile old/libselinux/src/seusers.c new/libselinux/src/seusers.c
--- old/libselinux/src/seusers.c	2005-11-04 09:33:06.000000000 -0500
+++ new/libselinux/src/seusers.c	2005-11-04 09:31:54.000000000 -0500
@@ -19,6 +19,7 @@ static int process_seusers(const char *b
 	char *newbuf = strdup(buffer);
 	char *luser = NULL, *seuser = NULL, *level = NULL;
 	char *start, *end;
+	int mls_found = 1;
 
 	if (!newbuf)
 		goto err;
@@ -42,8 +43,8 @@ static int process_seusers(const char *b
 	start = end+1;
 	end = strchr(start, ':');
 	if (!end) {
-		if (mls_enabled)
-			goto err; /* no MLS level and MLS is enabled */
+		mls_found = 0;
+
 		/* MLS is disabled, so :level suffix not required. */
 		end = start;
 		while (*end && !isspace(*end))
@@ -55,7 +56,7 @@ static int process_seusers(const char *b
 	if (!seuser)
 		goto err;
 
-	if (!mls_enabled)
+	if (!mls_enabled || !mls_found)
 		goto out; /* skip any MLS level */
 
 	start = ++end;
@@ -63,11 +64,9 @@ static int process_seusers(const char *b
 		end++;
 	*end = 0;
 
-	if (*start && !isspace(*start)) {
-		level = strdup(start);
-		if (!level)
-			goto err;
-	}
+	level = strdup(start);
+	if (!level)
+		goto err;
 
 out:
 	free(newbuf);

  reply	other threads:[~2005-11-04 14:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-03 19:33 [PATCH] libselinux Jonathan Kim
2005-11-03 20:10 ` Stephen Smalley
2005-11-03 20:33   ` Stephen Smalley
2005-11-03 20:47     ` Stephen Smalley
2005-11-03 21:29       ` [ SEMANAGE] Resync seuser parser Ivan Gyurdiev
2005-11-04  7:59         ` Ivan Gyurdiev
2005-11-04  8:15           ` Ivan Gyurdiev
2005-11-04 13:47             ` Stephen Smalley
2005-11-04 14:35               ` Ivan Gyurdiev [this message]
2005-11-04 14:51                 ` Ivan Gyurdiev
2005-11-04 14:38                   ` Stephen Smalley
2005-11-04 13:23           ` Stephen Smalley

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=436B71C7.700@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=SELinux@tycho.nsa.gov \
    --cc=chanson@TrustedCS.com \
    --cc=jkim@TrustedCS.com \
    --cc=sds@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.