Add decent constants for python for return of getenforce call.

This commit is contained in:
Dan Walsh 2013-10-09 16:26:43 -04:00 committed by Stephen Smalley
parent 22671378f1
commit 9639f5d9a8

View file

@ -10,6 +10,10 @@
import shutil, os, stat import shutil, os, stat
DISABLED = -1
PERMISSIVE = 0
ENFORCING = 1
def restorecon(path, recursive=False): def restorecon(path, recursive=False):
""" Restore SELinux context on a given path """ """ Restore SELinux context on a given path """
@ -74,6 +78,10 @@ def install(src, dest):
$1 = &temp; $1 = &temp;
} }
%typemap(in, numinputs=0) void *(char *temp=NULL) {
$1 = temp;
}
/* Makes security_compute_user() return a Python list of contexts */ /* Makes security_compute_user() return a Python list of contexts */
%typemap(argout) (security_context_t **con) { %typemap(argout) (security_context_t **con) {
PyObject* plist; PyObject* plist;