All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Ivan Gyurdiev <ivg2@cornell.edu>, selinux@tycho.nsa.gov
Subject: Re: Strange staff role problems...
Date: Wed, 23 Feb 2005 11:53:07 -0500	[thread overview]
Message-ID: <421CB4F3.5040803@redhat.com> (raw)
In-Reply-To: <1109176324.17298.85.camel@moss-spartans.epoch.ncsc.mil>

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

Stephen Smalley wrote:

>On Wed, 2005-02-23 at 11:29 -0500, Daniel J Walsh wrote:
>  
>
>>Should be in Rawhide tonight.  I have put it out on my people page
>>ftp://people.redhat.com/dwalsh/SELinux/Fedora
>>
>>I have attached the patch.
>>    
>>
>
>1) data_size should be size_t (same as fix by Ulrich to load_policy).
>
>2) Error message looks like it is missing a verb (while <blank> user
>configuration), and the comment is cut-and-paste from the booleans.
>
>3) Do you really want it to fail completely if sepol_genusers() returns
>an error other than ENOENT or EINVAL (e.g. ENOMEM is possible, EACCES is
>possible if it lacks permission to read the file, ...)?  Likely should
>just always proceed with the original binary policy if there is any
>error from sepol_genusers().  That will let the system come up with
>system_u, user_u, and root for basic recovery.
>
>  
>
Ok try again.

[-- Attachment #2: sysvinit-2.85-selgenusers.patch --]
[-- Type: text/plain, Size: 1329 bytes --]

--- sysvinit-2.85/src/init.c.selgenusers	2005-02-23 11:47:17.000000000 -0500
+++ sysvinit-2.85/src/init.c	2005-02-23 11:51:07.000000000 -0500
@@ -199,9 +199,10 @@
 static int load_policy(int *enforce) 
 {
 	int fd=-1,ret=-1;
+	size_t data_size;
 	int rc=0, orig_enforce;
 	struct stat sb;
-	void *map;
+	void *map, *data;
 	char policy_file[PATH_MAX];
 	int policy_version=0;
 	FILE *cfg;
@@ -306,8 +307,16 @@
 	}
 
 
+	/* Set SELinux users based on a local.users configuration file. */
+	ret = sepol_genusers(map, sb.st_size, selinux_users_path(), &data, &data_size);
+	if (ret < 0) {
+		log(L_VB,"Warning!  Error while reading user configuration from %s/{local.users,system.users}:  %s\n", selinux_users_path(), strerror(errno));
+		data=map;
+		data_size=sb.st_size;
+	}
+
 	/* Set booleans based on a booleans configuration file. */
-	ret = sepol_genbools(map, sb.st_size, selinux_booleans_path());
+	ret = sepol_genbools(data, data_size, selinux_booleans_path());
 	if (ret < 0) {
 		if (errno == ENOENT || errno == EINVAL) {
 			/* No booleans file or stale booleans in the file; non-fatal. */
@@ -320,7 +329,7 @@
 		}
 	}
 	log(L_VB, "Loading security policy\n");
-	ret=security_load_policy(map, sb.st_size);
+	ret=security_load_policy(data, data_size);
 	if (ret < 0) {
 		log(L_VB, "security_load_policy failed\n");
 	}

  reply	other threads:[~2005-02-23 16:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-23  4:07 Strange staff role problems Ivan Gyurdiev
2005-02-23 13:00 ` Stephen Smalley
2005-02-23 16:29   ` Daniel J Walsh
2005-02-23 16:32     ` Stephen Smalley
2005-02-23 16:53       ` Daniel J Walsh [this message]
2005-02-23 17:12         ` Stephen Smalley
2005-02-25  4:52           ` Ivan Gyurdiev
2005-02-25 14:06             ` Daniel J Walsh
2005-02-28 18:45             ` 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=421CB4F3.5040803@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=ivg2@cornell.edu \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@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.