[PATCH 63/74] seinfo needs to work if mls is disabled.

[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.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJpN1AACgkQrlYvE4MpobM/UACggs0X/cBLfEy8ENeJQ8YbI8LP
lBQAoIuD7acX0ZifDH3JNNIKr1pZrmOT
=y+x8
-----END PGP SIGNATURE-----
>From 584b5cf89d00657596de212e94c92c6eeb82bae9 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Fri, 11 Oct 2013 10:04:20 -0400
Subject: [PATCH 63/74] seinfo needs to work if mls is disabled.

This patch stops seinfo from failing when MLS disabled.
---
 policycoreutils/sepolicy/info.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/policycoreutils/sepolicy/info.c b/policycoreutils/sepolicy/info.c
index b6244be..cd1026a 100644
--- a/policycoreutils/sepolicy/info.c
+++ b/policycoreutils/sepolicy/info.c
@@ -884,16 +884,14 @@ static PyObject*  get_ports(const char *num, const apol_policy_t * policydb)
 		if (py_insert_string(dict, "type", type))
 			goto err;
 
-		if((range = apol_context_get_range(c)) == NULL) {
-			goto err;
-		}
-			
-		range_str = apol_mls_range_render(policydb, range);
-		if (range_str == NULL) {
-			goto err;
+		if((range = apol_context_get_range(c)) != NULL) {
+			range_str = apol_mls_range_render(policydb, range);
+			if (range_str == NULL) {
+				goto err;
+			}
+			if (py_insert_string(dict, "range", range_str))
+				goto err;
 		}
-		if (py_insert_string(dict, "range", range_str))
-			goto err;
 
 		if (py_insert_string(dict, "protocol", proto_str))
 			goto err;
-- 
1.8.3.1


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

  Powered by Linux