All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Modify audit2why analyze function to use loaded policy
@ 2016-06-03 15:09 Joshua Brindle
  2016-06-03 15:09 ` [PATCH 2/2] Correctly detect unknown classes in sepol_string_to_security_class Joshua Brindle
  2016-06-20 20:33 ` [PATCH 1/2] Modify audit2why analyze function to use loaded policy Stephen Smalley
  0 siblings, 2 replies; 7+ messages in thread
From: Joshua Brindle @ 2016-06-03 15:09 UTC (permalink / raw)
  To: selinux

Class and perms should come from the policy being used for analysis,
not the system policy so use sepol_ interfaces

Change-Id: Ia0590ed2514249fd98810a8d4fe87f8bf5280561
Signed-off-by: Joshua Brindle <brindle@quarksecurity.com>
---
 libselinux/src/audit2why.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libselinux/src/audit2why.c b/libselinux/src/audit2why.c
index 12745b3..abe1701 100644
--- a/libselinux/src/audit2why.c
+++ b/libselinux/src/audit2why.c
@@ -343,8 +343,8 @@ static PyObject *analyze(PyObject *self __attribute__((unused)) , PyObject *args
 	if (rc < 0)
 		RETURN(BADTCON)
 
-	tclass = string_to_security_class(tclassstr);
-	if (!tclass)
+	rc = sepol_string_to_security_class(tclassstr, &tclass);
+	if (rc < 0)
 		RETURN(BADTCLASS)
 
 	/* Convert the permission list to an AV. */
@@ -365,8 +365,8 @@ static PyObject *analyze(PyObject *self __attribute__((unused)) , PyObject *args
 		permstr = PyString_AsString( strObj );
 #endif
 		
-		perm = string_to_av_perm(tclass, permstr);
-		if (!perm)
+		rc = sepol_string_to_av_perm(tclass, permstr, &perm);
+		if (rc < 0)
 			RETURN(BADPERM)
 
 		av |= perm;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-21 14:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03 15:09 [PATCH 1/2] Modify audit2why analyze function to use loaded policy Joshua Brindle
2016-06-03 15:09 ` [PATCH 2/2] Correctly detect unknown classes in sepol_string_to_security_class Joshua Brindle
2016-06-03 15:17   ` [PATCH] " Joshua Brindle
2016-06-03 15:18     ` Joshua Brindle
2016-06-20 20:34     ` Stephen Smalley
2016-06-21 14:25       ` Joshua Brindle
2016-06-20 20:33 ` [PATCH 1/2] Modify audit2why analyze function to use loaded policy Stephen Smalley

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.