- Turn off messages in audit2why
This commit is contained in:
		
							parent
							
								
									5abec270e9
								
							
						
					
					
						commit
						4235807de2
					
				| @ -50,7 +50,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libs | ||||
| +secon(8), selinuxconlist(8)
 | ||||
| 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
 | ||||
| +++ 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 @@
 | ||||
| +/* Workaround for http://bugs.python.org/issue4835 */
 | ||||
| +#define SIZEOF_SOCKET_T SIZEOF_INT
 | ||||
| @ -58,32 +58,41 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/audit2why.c libselinux-2. | ||||
|  #include <Python.h> | ||||
|  #include <unistd.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) { | ||||
|    int result; | ||||
|    char *init_path=NULL; | ||||
| -  if (PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path)) 
 | ||||
| -	  result = __policy_init(init_path);
 | ||||
| +  if (!PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path))  {
 | ||||
| +	  return NULL;
 | ||||
| +  if (!PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path)) {
 | ||||
| +    return NULL;
 | ||||
| +  }
 | ||||
| +  result = __policy_init(init_path);
 | ||||
|    return Py_BuildValue("i", result); | ||||
|  } | ||||
|   | ||||
| @@ -353,7 +358,11 @@
 | ||||
| @@ -353,7 +360,11 @@
 | ||||
|  		strObj = PyList_GetItem(listObj, i); /* Can't fail */ | ||||
|  		 | ||||
|  		/* make it a string */ | ||||
| +#if PY_MAJOR_VERSION >= 3
 | ||||
| +		permstr = PyBytes_AsString( strObj );
 | ||||
| +		permstr = _PyUnicode_AsString( strObj );
 | ||||
| +#else
 | ||||
|  		permstr = PyString_AsString( strObj ); | ||||
| +#endif
 | ||||
|  		 | ||||
|  		perm = string_to_av_perm(tclass, permstr); | ||||
|  		if (!perm) { | ||||
| @@ -423,10 +432,39 @@
 | ||||
| @@ -423,10 +434,39 @@
 | ||||
|      {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,"BADSCON", BADSCON); | ||||
|  	PyModule_AddIntConstant(m,"BADTCON", BADTCON); | ||||
| @@ -440,4 +478,8 @@
 | ||||
| @@ -440,4 +480,8 @@
 | ||||
|  	PyModule_AddIntConstant(m,"BOOLEAN", BOOLEAN); | ||||
|  	PyModule_AddIntConstant(m,"CONSTRAINT", CONSTRAINT); | ||||
|  	PyModule_AddIntConstant(m,"RBAC", RBAC); | ||||
|  | ||||
| @ -7,7 +7,7 @@ | ||||
| Summary: SELinux library and simple utilities | ||||
| Name: libselinux | ||||
| Version: 2.0.96 | ||||
| Release: 1%{?dist} | ||||
| Release: 2%{?dist} | ||||
| License: Public Domain | ||||
| Group: System Environment/Libraries | ||||
| Source: http://www.nsa.gov/research/selinux/%{name}-%{version}.tgz | ||||
| @ -230,6 +230,9 @@ exit 0 | ||||
| %{ruby_sitearch}/selinux.so | ||||
| 
 | ||||
| %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 | ||||
| - Update to upstream  | ||||
| 	* Add const qualifiers to public API where appropriate by KaiGai Kohei. | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user