[PATCH 41/48] libselinux: return EINVAL if invalid role selected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


   This patch looks good to me. acked.

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

iEYEARECAAYFAk7dHdgACgkQrlYvE4MpobNv1ACeLTzML8D4EkvA8AlrYQq3EH5y
dnwAoJ11+aC3a7hqhEa8KopmKU2kAeHc
=UdEj
-----END PGP SIGNATURE-----
>From 29f5424de555073e184f7adcb206a34fe0cbdb0c Mon Sep 17 00:00:00 2001
From: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
Date: Sun, 27 Nov 2011 16:08:10 +0000
Subject: [PATCH 41/48] libselinux: return EINVAL if invalid role selected

For get_default_context_with_role(3) and get_default_context_with_rolelevel(3),
return errno = EINVAL if invalid role.

Signed-off-by: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 libselinux/src/get_context_list.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libselinux/src/get_context_list.c b/libselinux/src/get_context_list.c
index 37d80f2..e02157c 100644
--- a/libselinux/src/get_context_list.c
+++ b/libselinux/src/get_context_list.c
@@ -38,8 +38,10 @@ int get_default_context_with_role(const char *user,
 	}
 
 	rc = -1;
-	if (!(*ptr))
+	if (!(*ptr)) {
+		errno = EINVAL;
 		goto out;
+	}
 	*newcon = strdup(*ptr);
 	if (!(*newcon))
 		goto out;
-- 
1.7.7.4


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux