All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: SELinux <selinux@tycho.nsa.gov>
Subject: Libsemanage genhomedircon to allow fallback users with no level
Date: Thu, 15 Dec 2011 10:39:54 -0500	[thread overview]
Message-ID: <4EEA14CA.6020906@redhat.com> (raw)

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you build a distribution without MLS turned on, libsemanage will
crash if given a user without a level.  This patch allows users
without levels to be passed in.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7qFMoACgkQrlYvE4MpobNIhwCbB/baCifURS4ldfZYo4eplezu
GwQAn0zyfeS4po8AK7zhJTtTjfUWWrKq
=oOTr
-----END PGP SIGNATURE-----

[-- Attachment #2: libsemanage-fallbackuser.patch --]
[-- Type: text/plain, Size: 805 bytes --]

diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c
index 847d87e..d2646ae 100644
--- a/libsemanage/src/genhomedircon.c
+++ b/libsemanage/src/genhomedircon.c
@@ -660,9 +717,12 @@ static int set_fallback_user(genhomedircon_settings_t *s, const char *user,
 {
 	char *fallback_user = strdup(user);
 	char *fallback_user_prefix = strdup(prefix);
-	char *fallback_user_level = strdup(level);
+	char *fallback_user_level = NULL;
+	if (level) 
+		fallback_user_level = strdup(level);
 
-	if (fallback_user == NULL || fallback_user_prefix == NULL || fallback_user_level == NULL) {
+	if (fallback_user == NULL || fallback_user_prefix == NULL ||
+	    (fallback_user_level == NULL && level != NULL)) {
 		free(fallback_user);
 		free(fallback_user_prefix);
 		free(fallback_user_level);

                 reply	other threads:[~2011-12-15 15:39 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=4EEA14CA.6020906@redhat.com \
    --to=dwalsh@redhat.com \
    --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.