Skip to contentSkip to conversation

libsemanage -- fallback-user-level

PATCH In review Laurent Bigonville 3 participants 3 messages Mar 26, 2012 – Mar 27, 2012 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 libsemanage -- fallback-user-level

Hi,

I've no rational and no original author about this patch.

libsemanage/src/genhomedircon.c +1 -1
@@ -863,7 +877,7 @@
 			level = semanage_user_get_mlslevel(*u);
 		} else {
 			prefix = name;
-			level = "s0";
+			level = FALLBACK_USER_LEVEL;
 		}
 
 		retval = getpwnam_r(name, &pwstorage, rbuf, rbuflen, &pwent);

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 1 line · Laurent Bigonville

I've no rational and no original author about this patch.

That would be mine. Having magic numbers in the code is a bad idea, using a macro is better.

Quoted 17 lines
libsemanage/src/genhomedircon.c +1 -2
@@ -863,7 +877,7 @@
 			level = semanage_user_get_mlslevel(*u);
 		} else {
 			prefix = name;
-			level = "s0";
+			level = FALLBACK_USER_LEVEL;
 		}
 
 		retval = getpwnam_r(name, &pwstorage, rbuf, rbuflen, &pwent);
 
--

This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

Signature · 7 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
In reply to Laurent Bigonville

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

Quoted 10 lines · Laurent Bigonville

Hi,

I've no rational and no original author about this patch.

--- a/libsemanage/src/genhomedircon.c +++ b/libsemanage/src/genhomedircon.c @@ -863,7 +877,7 @@ level =
semanage_user_get_mlslevel(*u); } else { prefix = name; - level =
"s0"; + level = FALLBACK_USER_LEVEL; }

Quoted 8 lines

retval = getpwnam_r(name, &pwstorage, rbuf, rbuflen, &pwent);

-- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

Looks good to me although I see this in two places.

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

iEYEARECAAYFAk9xyz8ACgkQrlYvE4MpobOV3QCfQfT77DP3b5sXDqmQ2vOoVVxl wukAoL137DCkrpJF6ISEE63oa6z8Td2e
=EHIC
-----END PGP SIGNATURE-----

libsemanage/src/genhomedircon.c +2 -2
index d2646ae..1b4c6c8 100644
@@ -772,7 +772,7 @@ static int setup_fallback_user(genhomedircon_settings_t * s)
 			if (semanage_user_query(s->h_semanage, key, &u) < 0)
 			{
 				prefix = name;
-				level = "s0";
+				level = FALLBACK_USER_LEVEL;
 			}
 			else
 			{
@@ -863,7 +863,7 @@ static genhomedircon_user_entry_t *get_users(genhomedircon_settings_t * s,
 			level = semanage_user_get_mlslevel(*u);
 		} else {
 			prefix = name;
-			level = "s0";
+			level = FALLBACK_USER_LEVEL;
 		}
 
 		retval = getpwnam_r(name, &pwstorage, rbuf, rbuflen, &pwent);