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: [ SEMANAGE] Resync seuser parser
Date: Thu, 03 Nov 2005 16:29:58 -0500	[thread overview]
Message-ID: <436A8156.5090003@cornell.edu> (raw)
In-Reply-To: <1131050864.23420.165.camel@moss-spartans.epoch.ncsc.mil>

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

Must keep the parsers in sync (or at least, the semanage parser should 
supercede the other one). Patch attached.

This is now perfectly valid on my machine (see below).
Loaded correctly, modified correcly, written back out in the same order, 
and straightened out into something sane.

test_user:root
                phantom:

        phantom:s0

__default__

        :user_u root:   root       :


s0


Test output
-----
There are 4 seusers before the transaction.

Now testing list...
Name: root, Seuser: root, MLS: s0
Name: __default__, Seuser: user_u, MLS: (null)
Name: phantom, Seuser: phantom, MLS: s0
Name: test_user, Seuser: root, MLS: (null)

Now testing iterate...
Name: root, Seuser: root, MLS: s0
Name: __default__, Seuser: user_u, MLS: (null)
Name: phantom, Seuser: phantom, MLS: s0
Name: test_user, Seuser: root, MLS: (null)

In-Transaction pre-commit iterate (should show modifications)..
Name: root, Seuser: root, MLS: s0
Name: __default__, Seuser: user_u, MLS: (null)
Name: phantom, Seuser: phantom, MLS: s0
Name: test_user, Seuser: root, MLS: s0:c5,c6-s2:c1,c3,c5

There are 4 seusers after the transaction

Now testing list
Name: root, Seuser: root, MLS: s0
Name: __default__, Seuser: user_u, MLS: (null)
Name: phantom, Seuser: phantom, MLS: s0
Name: test_user, Seuser: root, MLS: s0:c5,c6-s2:c1,c3,c5

Now testing iterate...
Name: root, Seuser: root, MLS: s0
Name: __default__, Seuser: user_u, MLS: (null)
Name: phantom, Seuser: phantom, MLS: s0
Name: test_user, Seuser: root, MLS: s0:c5,c6-s2:c1,c3,c5

[-- Attachment #2: libsemanage.seuser_resync.diff --]
[-- Type: text/x-patch, Size: 749 bytes --]

diff -Naurp --exclude CVS --exclude ChangeLog --exclude VERSION --exclude Makefile old/libsemanage/src/seusers_file.c new/libsemanage/src/seusers_file.c
--- old/libsemanage/src/seusers_file.c	2005-11-03 12:48:03.000000000 -0500
+++ new/libsemanage/src/seusers_file.c	2005-11-03 16:21:49.000000000 -0500
@@ -81,8 +81,8 @@ static int seuser_parse(
 	if (is_selinux_mls_enabled()) {
 		if (parse_skip_space(handle, info) < 0)
 			goto err;
-		if (parse_assert_ch(handle, info, ':') < 0)
-			goto err;
+		if (parse_optional_ch(info, ':') == STATUS_NODATA)
+			goto out;
 		if (parse_skip_space(handle, info) < 0)
 			goto err;
 
@@ -95,7 +95,8 @@ static int seuser_parse(
 		free(str);
 		str = NULL;
 	} 
-
+	
+	out:
 	return STATUS_SUCCESS;
 
 	last:

  reply	other threads:[~2005-11-03 21:29 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       ` Ivan Gyurdiev [this message]
2005-11-04  7:59         ` [ SEMANAGE] Resync seuser parser Ivan Gyurdiev
2005-11-04  8:15           ` Ivan Gyurdiev
2005-11-04 13:47             ` Stephen Smalley
2005-11-04 14:35               ` Ivan Gyurdiev
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=436A8156.5090003@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.