- Turn off messages in audit2why

This commit is contained in:
Daniel J Walsh 2010-06-25 21:05:56 +00:00
parent 5abec270e9
commit 4235807de2
2 changed files with 21 additions and 9 deletions

View File

@ -50,7 +50,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libs
+secon(8), selinuxconlist(8) +secon(8), selinuxconlist(8)
diff --exclude-from=exclude -N -u -r nsalibselinux/src/audit2why.c libselinux-2.0.96/src/audit2why.c diff --exclude-from=exclude -N -u -r nsalibselinux/src/audit2why.c libselinux-2.0.96/src/audit2why.c
--- nsalibselinux/src/audit2why.c 2010-05-19 14:45:51.000000000 -0400 --- nsalibselinux/src/audit2why.c 2010-05-19 14:45:51.000000000 -0400
+++ libselinux-2.0.96/src/audit2why.c 2010-06-16 09:20:34.000000000 -0400 +++ libselinux-2.0.96/src/audit2why.c 2010-06-25 17:03:37.000000000 -0400
@@ -1,3 +1,6 @@ @@ -1,3 +1,6 @@
+/* Workaround for http://bugs.python.org/issue4835 */ +/* Workaround for http://bugs.python.org/issue4835 */
+#define SIZEOF_SOCKET_T SIZEOF_INT +#define SIZEOF_SOCKET_T SIZEOF_INT
@ -58,7 +58,16 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/audit2why.c libselinux-2.
#include <Python.h> #include <Python.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
@@ -287,8 +290,10 @@ @@ -255,6 +258,8 @@
fclose(fp);
sepol_set_policydb(&avc->policydb->p);
avc->handle = sepol_handle_create();
+ /* Turn off messages */
+ sepol_msg_set_callback(avc->handle, NULL, NULL);
rc = sepol_bool_count(avc->handle,
avc->policydb, &cnt);
@@ -287,8 +292,10 @@
static PyObject *init(PyObject *self __attribute__((unused)), PyObject *args) { static PyObject *init(PyObject *self __attribute__((unused)), PyObject *args) {
int result; int result;
char *init_path=NULL; char *init_path=NULL;
@ -71,19 +80,19 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/audit2why.c libselinux-2.
return Py_BuildValue("i", result); return Py_BuildValue("i", result);
} }
@@ -353,7 +358,11 @@ @@ -353,7 +360,11 @@
strObj = PyList_GetItem(listObj, i); /* Can't fail */ strObj = PyList_GetItem(listObj, i); /* Can't fail */
/* make it a string */ /* make it a string */
+#if PY_MAJOR_VERSION >= 3 +#if PY_MAJOR_VERSION >= 3
+ permstr = PyBytes_AsString( strObj ); + permstr = _PyUnicode_AsString( strObj );
+#else +#else
permstr = PyString_AsString( strObj ); permstr = PyString_AsString( strObj );
+#endif +#endif
perm = string_to_av_perm(tclass, permstr); perm = string_to_av_perm(tclass, permstr);
if (!perm) { if (!perm) {
@@ -423,10 +432,39 @@ @@ -423,10 +434,39 @@
{NULL, NULL, 0, NULL} /* Sentinel */ {NULL, NULL, 0, NULL} /* Sentinel */
}; };
@ -124,7 +133,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/audit2why.c libselinux-2.
PyModule_AddIntConstant(m,"UNKNOWN", UNKNOWN); PyModule_AddIntConstant(m,"UNKNOWN", UNKNOWN);
PyModule_AddIntConstant(m,"BADSCON", BADSCON); PyModule_AddIntConstant(m,"BADSCON", BADSCON);
PyModule_AddIntConstant(m,"BADTCON", BADTCON); PyModule_AddIntConstant(m,"BADTCON", BADTCON);
@@ -440,4 +478,8 @@ @@ -440,4 +480,8 @@
PyModule_AddIntConstant(m,"BOOLEAN", BOOLEAN); PyModule_AddIntConstant(m,"BOOLEAN", BOOLEAN);
PyModule_AddIntConstant(m,"CONSTRAINT", CONSTRAINT); PyModule_AddIntConstant(m,"CONSTRAINT", CONSTRAINT);
PyModule_AddIntConstant(m,"RBAC", RBAC); PyModule_AddIntConstant(m,"RBAC", RBAC);

View File

@ -7,7 +7,7 @@
Summary: SELinux library and simple utilities Summary: SELinux library and simple utilities
Name: libselinux Name: libselinux
Version: 2.0.96 Version: 2.0.96
Release: 1%{?dist} Release: 2%{?dist}
License: Public Domain License: Public Domain
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://www.nsa.gov/research/selinux/%{name}-%{version}.tgz Source: http://www.nsa.gov/research/selinux/%{name}-%{version}.tgz
@ -230,6 +230,9 @@ exit 0
%{ruby_sitearch}/selinux.so %{ruby_sitearch}/selinux.so
%changelog %changelog
* Fri Jun 25 2010 Dan Walsh <dwalsh@redhat.com> - 2.0.96-2
- Turn off messages in audit2why
* Wed Mar 24 2010 Dan Walsh <dwalsh@redhat.com> - 2.0.96-1 * Wed Mar 24 2010 Dan Walsh <dwalsh@redhat.com> - 2.0.96-1
- Update to upstream - Update to upstream
* Add const qualifiers to public API where appropriate by KaiGai Kohei. * Add const qualifiers to public API where appropriate by KaiGai Kohei.