-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Improve python bindings to add constant names for Enforcing Permissive disabled. This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJpJ1UACgkQrlYvE4MpobMjoQCfV05lt2EVC1nYPWbIWYW1M2Wm xvAAn0RIXAx0K3OSs+ZG+zSCrc05zYh0 =OGdg -----END PGP SIGNATURE-----
>From 1638fada813aaff2296f89a3322285cd6d14db29 Mon Sep 17 00:00:00 2001 From: Dan Walsh <dwalsh@xxxxxxxxxx> Date: Wed, 9 Oct 2013 16:26:43 -0400 Subject: [PATCH 17/74] Add decent constants for python for return of getenforce call. --- libselinux/src/selinuxswig_python.i | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libselinux/src/selinuxswig_python.i b/libselinux/src/selinuxswig_python.i index 359bd02..9884454 100644 --- a/libselinux/src/selinuxswig_python.i +++ b/libselinux/src/selinuxswig_python.i @@ -10,6 +10,10 @@ import shutil, os, stat +DISABLED = -1 +PERMISSIVE = 0 +ENFORCING = 1 + def restorecon(path, recursive=False): """ Restore SELinux context on a given path """ @@ -74,6 +78,10 @@ def install(src, dest): $1 = &temp; } +%typemap(in, numinputs=0) void *(char *temp=NULL) { + $1 = temp; +} + /* Makes security_compute_user() return a Python list of contexts */ %typemap(argout) (security_context_t **con) { PyObject* plist; -- 1.8.3.1