mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-21 20:16:51 +00:00
Modify audit2why analyze function to use loaded policy
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>
This commit is contained in:
parent
999747aa57
commit
dae5c271fc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user