psss / rpms / libselinux

Forked from rpms/libselinux 5 years ago
Clone
c49c04d
diff --git a/libselinux/man/man8/selinux.8 b/libselinux/man/man8/selinux.8
c49c04d
index 5caa592..1fc5b95 100644
c49c04d
--- a/libselinux/man/man8/selinux.8
c49c04d
+++ b/libselinux/man/man8/selinux.8
c49c04d
@@ -1,7 +1,7 @@
c49c04d
 .TH  "selinux"  "8"  "29 Apr 2005" "dwalsh@redhat.com" "SELinux Command Line documentation"
c49c04d
 
c49c04d
 .SH "NAME"
c49c04d
-selinux \- NSA Security-Enhanced Linux (SELinux)
c49c04d
+SELinux \- NSA Security-Enhanced Linux (SELinux)
c49c04d
 
c49c04d
 .SH "DESCRIPTION"
c49c04d
 
c49c04d
@@ -62,12 +62,12 @@ compile-time tunable options and a set of runtime policy booleans.
c49c04d
 .B system-config-securitylevel
c49c04d
 allows customization of these booleans and tunables.
c49c04d
 
c49c04d
-Many domains that are protected by SELinux also include selinux man pages explainging how to customize their policy.  
c49c04d
+Many domains that are protected by SELinux also include SELinux man pages explaining how to customize their policy.  
c49c04d
 
c49c04d
 .SH FILE LABELING
c49c04d
 
c49c04d
 All files, directories, devices ... have a security context/label associated with them.  These context are stored in the extended attributes of the file system.
c49c04d
-Problems with SELinux often arise from the file system being mislabeled. This can be caused by booting the machine with a non selinux kernel.  If you see an error message containing file_t, that is usually a good indicator that you have a serious problem with file system labeling.  
c49c04d
+Problems with SELinux often arise from the file system being mislabeled. This can be caused by booting the machine with a non SELinux kernel.  If you see an error message containing file_t, that is usually a good indicator that you have a serious problem with file system labeling.  
c49c04d
 
c49c04d
 The best way to relabel the file system is to create the flag file /.autorelabel and reboot.  system-config-securitylevel, also has this capability.  The restorcon/fixfiles commands are also available for relabeling files. 
c49c04d
   
c49c04d
diff --git a/libselinux/man/man8/selinuxconlist.8 b/libselinux/man/man8/selinuxconlist.8
c49c04d
new file mode 100644
c49c04d
index 0000000..c698daa
c49c04d
--- /dev/null
c49c04d
+++ b/libselinux/man/man8/selinuxconlist.8
c49c04d
@@ -0,0 +1,18 @@
c49c04d
+.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
c49c04d
+.SH "NAME"
c49c04d
+selinuxconlist \- list all SELinux context reachable for user
c49c04d
+.SH "SYNOPSIS"
c49c04d
+.B selinuxconlist [-l level] user [context]
c49c04d
+
c49c04d
+.SH "DESCRIPTION"
c49c04d
+.B selinuxconlist
c49c04d
+reports the list of context reachable for user from the current context or specified context
c49c04d
+
c49c04d
+.B \-l level
c49c04d
+mcs/mls level
c49c04d
+
c49c04d
+.SH AUTHOR	
c49c04d
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
c49c04d
+
c49c04d
+.SH "SEE ALSO"
c49c04d
+secon(8), selinuxdefcon(8)
c49c04d
diff --git a/libselinux/man/man8/selinuxdefcon.8 b/libselinux/man/man8/selinuxdefcon.8
c49c04d
new file mode 100644
c49c04d
index 0000000..3cbeff2
c49c04d
--- /dev/null
c49c04d
+++ b/libselinux/man/man8/selinuxdefcon.8
c49c04d
@@ -0,0 +1,24 @@
c49c04d
+.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
c49c04d
+.SH "NAME"
c49c04d
+selinuxdefcon \- report default SELinux context for user 
c49c04d
+
c49c04d
+.SH "SYNOPSIS"
c49c04d
+.B selinuxdefcon [-l level] user fromcon
c49c04d
+
c49c04d
+.SH "DESCRIPTION"
c49c04d
+.B selinuxdefcon
c49c04d
+reports the default context for the specified user from the specified context
c49c04d
+
c49c04d
+.B \-l level
c49c04d
+mcs/mls level
c49c04d
+
c49c04d
+.SH EXAMPLE
c49c04d
+# selinuxdefcon jsmith system_u:system_r:sshd_t:s0
c49c04d
+.br
c49c04d
+unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
c49c04d
+
c49c04d
+.SH AUTHOR	
c49c04d
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
c49c04d
+
c49c04d
+.SH "SEE ALSO"
c49c04d
+secon(8), selinuxconlist(8)
ca9cea7
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
3c1b814
index bf665ab..ccd08ae 100644
ca9cea7
--- a/libselinux/src/Makefile
ca9cea7
+++ b/libselinux/src/Makefile
3c1b814
@@ -1,10 +1,11 @@
ca9cea7
 # Installation directories.
ca9cea7
+PYTHON ?= python
ca9cea7
 PREFIX ?= $(DESTDIR)/usr
ca9cea7
 LIBDIR ?= $(PREFIX)/lib
ca9cea7
 SHLIBDIR ?= $(DESTDIR)/lib
ca9cea7
 INCLUDEDIR ?= $(PREFIX)/include
ca9cea7
-PYLIBVER ?= $(shell python -c 'import sys;print "python%d.%d" % sys.version_info[0:2]')
3c1b814
-PYINC ?= /usr/include/$(PYLIBVER)
ca9cea7
+PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])')
3c1b814
+PYINC ?= $(shell pkg-config --cflags `basename $(PYTHON)`)
ca9cea7
 PYLIB ?= /usr/lib/$(PYLIBVER)
ca9cea7
 PYTHONLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
3c1b814
 RUBYLIBVER ?= $(shell ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
ca9cea7
@@ -23,13 +24,13 @@ SWIGIF= selinuxswig_python.i selinuxswig_python_exception.i
ca9cea7
 SWIGRUBYIF= selinuxswig_ruby.i
ca9cea7
 SWIGCOUT= selinuxswig_wrap.c
ca9cea7
 SWIGRUBYCOUT= selinuxswig_ruby_wrap.c
ca9cea7
-SWIGLOBJ:= $(patsubst %.c,%.lo,$(SWIGCOUT)) 
ca9cea7
+SWIGLOBJ:= $(patsubst %.c,$(PYPREFIX)%.lo,$(SWIGCOUT)) 
ca9cea7
 SWIGRUBYLOBJ:= $(patsubst %.c,%.lo,$(SWIGRUBYCOUT)) 
ca9cea7
-SWIGSO=_selinux.so
ca9cea7
+SWIGSO=$(PYPREFIX)_selinux.so
ca9cea7
 SWIGFILES=$(SWIGSO) selinux.py selinuxswig_python_exception.i
ca9cea7
 SWIGRUBYSO=_rubyselinux.so
ca9cea7
 LIBSO=$(TARGET).$(LIBVERSION)
ca9cea7
-AUDIT2WHYSO=audit2why.so
ca9cea7
+AUDIT2WHYSO=$(PYPREFIX)audit2why.so
ca9cea7
 
ca9cea7
 ifeq ($(DISABLE_AVC),y)
ca9cea7
 	UNUSED_SRCS+=avc.c avc_internal.c avc_sidtab.c mapping.c stringrep.c checkAccess.c
3c1b814
@@ -70,7 +71,7 @@ $(LIBA):  $(OBJS)
3c1b814
 	$(RANLIB) $@
3c1b814
 
3c1b814
 $(SWIGLOBJ): $(SWIGCOUT)
3c1b814
-	$(CC) $(filter-out -Werror,$(CFLAGS)) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
3c1b814
+	$(CC) $(filter-out -Werror,$(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
3c1b814
 
3c1b814
 $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
3c1b814
 	$(CC) $(filter-out -Werror,$(CFLAGS)) -I$(RUBYINC) -fPIC -DSHARED -c -o $@ $<
ca9cea7
@@ -91,10 +92,10 @@ $(LIBPC): $(LIBPC).in
ca9cea7
 selinuxswig_python_exception.i: ../include/selinux/selinux.h
ca9cea7
 	bash exception.sh > $@ 
ca9cea7
 
ca9cea7
-audit2why.lo: audit2why.c
3c1b814
-	$(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
ca9cea7
+$(PYPREFIX)audit2why.lo: audit2why.c
3c1b814
+	$(CC) $(CFLAGS) $(PYINC) -fPIC -DSHARED -c -o $@ $<
ca9cea7
 
ca9cea7
-$(AUDIT2WHYSO): audit2why.lo
ca9cea7
+$(AUDIT2WHYSO): $(PYPREFIX)audit2why.lo
ca9cea7
 	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux ${LIBDIR}/libsepol.a -L$(LIBDIR) -Wl,-soname,$@
ca9cea7
 
ca9cea7
 %.o:  %.c policy.h
ca9cea7
@@ -123,8 +124,8 @@ install: all
ca9cea7
 
ca9cea7
 install-pywrap: pywrap
ca9cea7
 	test -d $(PYTHONLIBDIR)/site-packages/selinux || install -m 755 -d $(PYTHONLIBDIR)/site-packages/selinux
ca9cea7
-	install -m 755 $(SWIGSO) $(PYTHONLIBDIR)/site-packages/selinux
ca9cea7
-	install -m 755 $(AUDIT2WHYSO) $(PYTHONLIBDIR)/site-packages/selinux
ca9cea7
+	install -m 755 $(SWIGSO) $(PYTHONLIBDIR)/site-packages/selinux/_selinux.so
ca9cea7
+	install -m 755 $(AUDIT2WHYSO) $(PYTHONLIBDIR)/site-packages/selinux/audit2why.so
ca9cea7
 	install -m 644  selinux.py $(PYTHONLIBDIR)/site-packages/selinux/__init__.py
ca9cea7
 
ca9cea7
 install-rubywrap: rubywrap
ca9cea7
diff --git a/libselinux/src/audit2why.c b/libselinux/src/audit2why.c
ca9cea7
index 691bc67..12e8614 100644
ca9cea7
--- a/libselinux/src/audit2why.c
ca9cea7
+++ b/libselinux/src/audit2why.c
5abec27
@@ -1,3 +1,6 @@
5abec27
+/* Workaround for http://bugs.python.org/issue4835 */
5abec27
+#define SIZEOF_SOCKET_T SIZEOF_INT
5abec27
+
5abec27
 #include <Python.h>
5abec27
 #include <unistd.h>
5abec27
 #include <stdlib.h>
ca9cea7
@@ -255,6 +258,8 @@ static int __policy_init(const char *init_path)
4235807
 	fclose(fp);
4235807
 	sepol_set_policydb(&avc->policydb->p);
4235807
 	avc->handle = sepol_handle_create();
4235807
+	/* Turn off messages */
4235807
+	sepol_msg_set_callback(avc->handle, NULL, NULL);
4235807
 
4235807
 	rc = sepol_bool_count(avc->handle,
4235807
 			      avc->policydb, &cnt);
ca9cea7
@@ -287,8 +292,10 @@ static int __policy_init(const char *init_path)
5abec27
 static PyObject *init(PyObject *self __attribute__((unused)), PyObject *args) {
5abec27
   int result;
5abec27
   char *init_path=NULL;
5abec27
-  if (PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path)) 
5abec27
-	  result = __policy_init(init_path);
4235807
+  if (!PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path)) {
4235807
+    return NULL;
5abec27
+  }
5abec27
+  result = __policy_init(init_path);
5abec27
   return Py_BuildValue("i", result);
5abec27
 }
5abec27
 
ca9cea7
@@ -353,7 +360,11 @@ static PyObject *analyze(PyObject *self __attribute__((unused)) , PyObject *args
5abec27
 		strObj = PyList_GetItem(listObj, i); /* Can't fail */
5abec27
 		
5abec27
 		/* make it a string */
5abec27
+#if PY_MAJOR_VERSION >= 3
4235807
+		permstr = _PyUnicode_AsString( strObj );
5abec27
+#else
5abec27
 		permstr = PyString_AsString( strObj );
5abec27
+#endif
5abec27
 		
5abec27
 		perm = string_to_av_perm(tclass, permstr);
5abec27
 		if (!perm) {
ca9cea7
@@ -423,10 +434,39 @@ static PyMethodDef audit2whyMethods[] = {
5abec27
     {NULL, NULL, 0, NULL}        /* Sentinel */
5abec27
 };
5abec27
 
5abec27
+#if PY_MAJOR_VERSION >= 3
5abec27
+/* Module-initialization logic specific to Python 3 */
5abec27
+struct module_state {
5abec27
+	/* empty for now */
5abec27
+};
5abec27
+static struct PyModuleDef moduledef = {
5abec27
+	PyModuleDef_HEAD_INIT,
5abec27
+	"audit2why",
5abec27
+	NULL,
5abec27
+	sizeof(struct module_state),
5abec27
+	audit2whyMethods,
5abec27
+	NULL,
5abec27
+	NULL,
5abec27
+	NULL,
5abec27
+	NULL
5abec27
+};
5abec27
+
5abec27
+PyMODINIT_FUNC
5abec27
+PyInit_audit2why(void)
5abec27
+#else
5abec27
 PyMODINIT_FUNC
5abec27
 initaudit2why(void)
5abec27
+#endif
5abec27
 {
5abec27
-	PyObject *m = Py_InitModule("audit2why", audit2whyMethods);
5abec27
+	PyObject *m;
5abec27
+#if PY_MAJOR_VERSION >= 3
5abec27
+	m = PyModule_Create(&moduledef);
5abec27
+	if (m == NULL) {
5abec27
+		return NULL;
5abec27
+	}
5abec27
+#else
5abec27
+	m  = Py_InitModule("audit2why", audit2whyMethods);
5abec27
+#endif
5abec27
 	PyModule_AddIntConstant(m,"UNKNOWN", UNKNOWN);
5abec27
 	PyModule_AddIntConstant(m,"BADSCON", BADSCON);
5abec27
 	PyModule_AddIntConstant(m,"BADTCON", BADTCON);
ca9cea7
@@ -440,4 +480,8 @@ initaudit2why(void)
5abec27
 	PyModule_AddIntConstant(m,"BOOLEAN", BOOLEAN);
5abec27
 	PyModule_AddIntConstant(m,"CONSTRAINT", CONSTRAINT);
5abec27
 	PyModule_AddIntConstant(m,"RBAC", RBAC);
5abec27
+
5abec27
+#if PY_MAJOR_VERSION >= 3
5abec27
+	return m;
5abec27
+#endif
5abec27
 }
ca9cea7
diff --git a/libselinux/src/callbacks.c b/libselinux/src/callbacks.c
ca9cea7
index b245364..7c47222 100644
ca9cea7
--- a/libselinux/src/callbacks.c
ca9cea7
+++ b/libselinux/src/callbacks.c
ca9cea7
@@ -16,6 +16,7 @@ default_selinux_log(int type __attribute__((unused)), const char *fmt, ...)
ee77868
 {
d0a06b2
 	int rc;
d0a06b2
 	va_list ap;
d0a06b2
+	if (is_selinux_enabled() == 0) return 0;
d0a06b2
 	va_start(ap, fmt);
d0a06b2
 	rc = vfprintf(stderr, fmt, ap);
d0a06b2
 	va_end(ap);
ca9cea7
diff --git a/libselinux/src/matchpathcon.c b/libselinux/src/matchpathcon.c
ca9cea7
index bb4eb9f..c9ae42f 100644
ca9cea7
--- a/libselinux/src/matchpathcon.c
ca9cea7
+++ b/libselinux/src/matchpathcon.c
974a6e4
@@ -2,6 +2,7 @@
974a6e4
 #include <string.h>
974a6e4
 #include <errno.h>
974a6e4
 #include <stdio.h>
974a6e4
+#include <syslog.h>
974a6e4
 #include "selinux_internal.h"
974a6e4
 #include "label_internal.h"
974a6e4
 #include "callbacks.h"
ca9cea7
@@ -60,7 +61,7 @@ static void
974a6e4
 {
974a6e4
 	va_list ap;
974a6e4
 	va_start(ap, fmt);
974a6e4
-	vfprintf(stderr, fmt, ap);
974a6e4
+	vsyslog(LOG_ERR, fmt, ap);
974a6e4
 	va_end(ap);
974a6e4
 }
b5b41bc
 
c49c04d
diff --git a/libselinux/src/selinux.py b/libselinux/src/selinux.py
c49c04d
index fd63a4f..705012c 100644
c49c04d
--- a/libselinux/src/selinux.py
c49c04d
+++ b/libselinux/src/selinux.py
c49c04d
@@ -1,5 +1,5 @@
c49c04d
 # This file was automatically generated by SWIG (http://www.swig.org).
c49c04d
-# Version 1.3.40
c49c04d
+# Version 2.0.1
c49c04d
 #
c49c04d
 # Do not make changes to this file unless you know what you are doing--modify
c49c04d
 # the SWIG interface file instead.
c49c04d
@@ -79,6 +79,14 @@ def restorecon(path, recursive=False):
c49c04d
                              map(restorecon, [os.path.join(dirname, fname)
c49c04d
                                               for fname in fnames]), None)
c49c04d
 
c49c04d
+def chcon(path, context, recursive=False):
c49c04d
+    """ Set the SELinux context on a given path """
c49c04d
+    lsetfilecon(path, context)
c49c04d
+    if recursive:
c49c04d
+        for root, dirs, files in os.walk(path):
c49c04d
+            for name in files + dirs:
c49c04d
+               lsetfilecon(os.path.join(root,name), context)
c49c04d
+
c49c04d
 def copytree(src, dest):
c49c04d
     """ An SELinux-friendly shutil.copytree method """
c49c04d
     shutil.copytree(src, dest)
c49c04d
@@ -1588,6 +1596,7 @@ get_default_type = _selinux.get_default_type
c49c04d
 SELABEL_CTX_FILE = _selinux.SELABEL_CTX_FILE
c49c04d
 SELABEL_CTX_MEDIA = _selinux.SELABEL_CTX_MEDIA
c49c04d
 SELABEL_CTX_X = _selinux.SELABEL_CTX_X
c49c04d
+SELABEL_CTX_DB = _selinux.SELABEL_CTX_DB
c49c04d
 SELABEL_OPT_UNUSED = _selinux.SELABEL_OPT_UNUSED
c49c04d
 SELABEL_OPT_VALIDATE = _selinux.SELABEL_OPT_VALIDATE
c49c04d
 SELABEL_OPT_BASEONLY = _selinux.SELABEL_OPT_BASEONLY
c49c04d
@@ -1621,6 +1630,15 @@ SELABEL_X_EVENT = _selinux.SELABEL_X_EVENT
c49c04d
 SELABEL_X_SELN = _selinux.SELABEL_X_SELN
c49c04d
 SELABEL_X_POLYPROP = _selinux.SELABEL_X_POLYPROP
c49c04d
 SELABEL_X_POLYSELN = _selinux.SELABEL_X_POLYSELN
c49c04d
+SELABEL_DB_DATABASE = _selinux.SELABEL_DB_DATABASE
c49c04d
+SELABEL_DB_SCHEMA = _selinux.SELABEL_DB_SCHEMA
c49c04d
+SELABEL_DB_TABLE = _selinux.SELABEL_DB_TABLE
c49c04d
+SELABEL_DB_COLUMN = _selinux.SELABEL_DB_COLUMN
c49c04d
+SELABEL_DB_SEQUENCE = _selinux.SELABEL_DB_SEQUENCE
c49c04d
+SELABEL_DB_VIEW = _selinux.SELABEL_DB_VIEW
c49c04d
+SELABEL_DB_PROCEDURE = _selinux.SELABEL_DB_PROCEDURE
c49c04d
+SELABEL_DB_BLOB = _selinux.SELABEL_DB_BLOB
c49c04d
+SELABEL_DB_TUPLE = _selinux.SELABEL_DB_TUPLE
c49c04d
 
c49c04d
 def is_selinux_enabled():
c49c04d
   return _selinux.is_selinux_enabled()
c49c04d
@@ -2201,6 +2219,10 @@ def selinux_x_context_path():
c49c04d
   return _selinux.selinux_x_context_path()
c49c04d
 selinux_x_context_path = _selinux.selinux_x_context_path
c49c04d
 
c49c04d
+def selinux_sepgsql_context_path():
c49c04d
+  return _selinux.selinux_sepgsql_context_path()
c49c04d
+selinux_sepgsql_context_path = _selinux.selinux_sepgsql_context_path
c49c04d
+
c49c04d
 def selinux_contexts_path():
c49c04d
   return _selinux.selinux_contexts_path()
c49c04d
 selinux_contexts_path = _selinux.selinux_contexts_path
ca9cea7
diff --git a/libselinux/src/selinuxswig_python.i b/libselinux/src/selinuxswig_python.i
ca9cea7
index dea0e80..bb227e9 100644
ca9cea7
--- a/libselinux/src/selinuxswig_python.i
ca9cea7
+++ b/libselinux/src/selinuxswig_python.i
ca9cea7
@@ -45,7 +45,7 @@ def install(src, dest):
5abec27
 	PyObject* list = PyList_New(*$2);
5abec27
 	int i;
5abec27
 	for (i = 0; i < *$2; i++) {
5abec27
-		PyList_SetItem(list, i, PyString_FromString((*$1)[i]));
5abec27
+		PyList_SetItem(list, i, PyBytes_FromString((*$1)[i]));
5abec27
 	}
5abec27
 	$result = SWIG_Python_AppendOutput($result, list);
5abec27
 }
ca9cea7
@@ -74,7 +74,9 @@ def install(src, dest):
5abec27
 			len++;
5abec27
 		plist = PyList_New(len);
5abec27
 		for (i = 0; i < len; i++) {
5abec27
-			PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
5abec27
+			PyList_SetItem(plist, i, 
5abec27
+                                       PyBytes_FromString((*$1)[i])
5abec27
+                                       );
5abec27
 		}
5abec27
 	} else {
5abec27
 		plist = PyList_New(0);
ca9cea7
@@ -91,7 +93,9 @@ def install(src, dest):
5abec27
 	if (*$1) {
5abec27
 		plist = PyList_New(result);
5abec27
 		for (i = 0; i < result; i++) {
5abec27
-			PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
5abec27
+			PyList_SetItem(plist, i, 
5abec27
+                                       PyBytes_FromString((*$1)[i])
5abec27
+                                       );
5abec27
 		}
5abec27
 	} else {
5abec27
 		plist = PyList_New(0);
ca9cea7
@@ -144,16 +148,20 @@ def install(src, dest):
5abec27
 	$1 = (char**) malloc(size + 1);
5abec27
 
5abec27
 	for(i = 0; i < size; i++) {
5abec27
-		if (!PyString_Check(PySequence_GetItem($input, i))) {
5abec27
-			PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings");
5abec27
+		if (!PyBytes_Check(PySequence_GetItem($input, i))) {
5abec27
+			PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
5abec27
+
5abec27
 			return NULL;
5abec27
 		}
5abec27
+
5abec27
 	}
5abec27
 		
5abec27
 	for(i = 0; i < size; i++) {
5abec27
 		s = PySequence_GetItem($input, i);
5abec27
-		$1[i] = (char*) malloc(PyString_Size(s) + 1);
5abec27
-		strcpy($1[i], PyString_AsString(s));
5abec27
+
5abec27
+		$1[i] = (char*) malloc(PyBytes_Size(s) + 1);
5abec27
+		strcpy($1[i], PyBytes_AsString(s));
5abec27
+
5abec27
 	}
5abec27
 	$1[size] = NULL;
5abec27
 }
c49c04d
diff --git a/libselinux/src/selinuxswig_wrap.c b/libselinux/src/selinuxswig_wrap.c
c49c04d
index e0884f6..e60a3d3 100644
c49c04d
--- a/libselinux/src/selinuxswig_wrap.c
c49c04d
+++ b/libselinux/src/selinuxswig_wrap.c
c49c04d
@@ -1,6 +1,6 @@
c49c04d
 /* ----------------------------------------------------------------------------
c49c04d
  * This file was automatically generated by SWIG (http://www.swig.org).
c49c04d
- * Version 1.3.40
c49c04d
+ * Version 2.0.1
c49c04d
  * 
c49c04d
  * This file is not intended to be easily readable and contains a number of 
c49c04d
  * coding conventions designed to improve portability and efficiency. Do not make
c49c04d
@@ -177,7 +177,7 @@
c49c04d
 /* 
c49c04d
    Flags/methods for returning states.
c49c04d
    
c49c04d
-   The SWIG conversion methods, as ConvertPtr, return and integer 
c49c04d
+   The SWIG conversion methods, as ConvertPtr, return an integer 
c49c04d
    that tells if the conversion was successful or not. And if not,
c49c04d
    an error code can be returned (see swigerrors.swg for the codes).
c49c04d
    
c49c04d
@@ -1064,9 +1064,6 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
c49c04d
 
c49c04d
 
c49c04d
 /* -----------------------------------------------------------------------------
c49c04d
- * See the LICENSE file for information on copyright, usage and redistribution
c49c04d
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
c49c04d
- *
c49c04d
  * pyrun.swg
c49c04d
  *
c49c04d
  * This file contains the runtime support for Python modules
c49c04d
@@ -1113,8 +1110,18 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
c49c04d
 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
c49c04d
 #define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
c49c04d
 #define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
c49c04d
-#define SWIG_fail                        		goto fail					   
c49c04d
+#define SWIG_fail                        		goto fail				
c49c04d
 
c49c04d
+/*
c49c04d
+ * Python 2.7 and newer and Python 3.1 and newer should use Capsules API instead of
c49c04d
+ * CObjects API.
c49c04d
+ */
c49c04d
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
c49c04d
+     (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0))
c49c04d
+#define USE_CAPSULES
c49c04d
+#define TYPE_POINTER_NAME \
c49c04d
+    ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
c49c04d
+#endif
c49c04d
 
c49c04d
 /* Runtime API implementation */
c49c04d
 
c49c04d
@@ -2047,10 +2054,13 @@ _SWIG_This(void)
c49c04d
     return SWIG_Python_str_FromChar("this");
c49c04d
 }
c49c04d
 
c49c04d
+static PyObject *swig_this = NULL;
c49c04d
+
c49c04d
 SWIGRUNTIME PyObject *
c49c04d
 SWIG_This(void)
c49c04d
 {
c49c04d
-  static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
c49c04d
+  if (swig_this == NULL)
c49c04d
+    swig_this = _SWIG_This();
c49c04d
   return swig_this;
c49c04d
 }
c49c04d
 
c49c04d
@@ -2154,7 +2164,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
c49c04d
               int newmemory = 0;
c49c04d
               *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
c49c04d
               if (newmemory == SWIG_CAST_NEW_MEMORY) {
c49c04d
-                assert(own);
c49c04d
+                assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
c49c04d
                 if (own)
c49c04d
                   *own = *own | SWIG_CAST_NEW_MEMORY;
c49c04d
               }
c49c04d
@@ -2424,8 +2434,12 @@ SWIG_Python_GetModule(void) {
c49c04d
 #ifdef SWIG_LINK_RUNTIME
c49c04d
     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
c49c04d
 #else
c49c04d
+#ifdef USE_CAPSULES
c49c04d
+    type_pointer = PyCapsule_Import(TYPE_POINTER_NAME, 0);
c49c04d
+#else
c49c04d
     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
c49c04d
 				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
c49c04d
+#endif
c49c04d
     if (PyErr_Occurred()) {
c49c04d
       PyErr_Clear();
c49c04d
       type_pointer = (void *)0;
c49c04d
@@ -2470,9 +2484,14 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
c49c04d
 SWIGRUNTIME void
c49c04d
 SWIG_Python_DestroyModule(void *vptr)
c49c04d
 {
c49c04d
+  size_t i;
c49c04d
+#ifdef USE_CAPSULES
c49c04d
+  swig_module_info *swig_module =
c49c04d
+    (swig_module_info *) PyCapsule_GetPointer((PyObject *)vptr, TYPE_POINTER_NAME);
c49c04d
+#else
c49c04d
   swig_module_info *swig_module = (swig_module_info *) vptr;
c49c04d
+#endif
c49c04d
   swig_type_info **types = swig_module->types;
c49c04d
-  size_t i;
c49c04d
   for (i =0; i < swig_module->size; ++i) {
c49c04d
     swig_type_info *ty = types[i];
c49c04d
     if (ty->owndata) {
c49c04d
@@ -2481,6 +2500,7 @@ SWIG_Python_DestroyModule(void *vptr)
c49c04d
     }
c49c04d
   }
c49c04d
   Py_DECREF(SWIG_This());
c49c04d
+  swig_this = NULL;
c49c04d
 }
c49c04d
 
c49c04d
 SWIGRUNTIME void
c49c04d
@@ -2494,9 +2514,18 @@ SWIG_Python_SetModule(swig_module_info *swig_module) {
c49c04d
   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
c49c04d
 				   swig_empty_runtime_method_table);
c49c04d
 #endif
c49c04d
+#ifdef USE_CAPSULES
c49c04d
+  PyObject *pointer = PyCapsule_New((void *)swig_module, TYPE_POINTER_NAME,
c49c04d
+				    (PyCapsule_Destructor)SWIG_Python_DestroyModule);
c49c04d
+#else
c49c04d
   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
c49c04d
+#endif
c49c04d
   if (pointer && module) {
c49c04d
+#ifdef USE_CAPSULES
c49c04d
+    PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
c49c04d
+#else
c49c04d
     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
c49c04d
+#endif
c49c04d
   } else {
c49c04d
     Py_XDECREF(pointer);
c49c04d
   }
c49c04d
@@ -2517,12 +2546,20 @@ SWIG_Python_TypeQuery(const char *type)
c49c04d
   PyObject *obj = PyDict_GetItem(cache, key);
c49c04d
   swig_type_info *descriptor;
c49c04d
   if (obj) {
c49c04d
+#ifdef USE_CAPSULES
c49c04d
+    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, type);
c49c04d
+#else
c49c04d
     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
c49c04d
+#endif
c49c04d
   } else {
c49c04d
     swig_module_info *swig_module = SWIG_Python_GetModule();
c49c04d
     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
c49c04d
     if (descriptor) {
c49c04d
+#ifdef USE_CAPSULES
c49c04d
+      obj = PyCapsule_New(descriptor, type, NULL);
c49c04d
+#else
c49c04d
       obj = PyCObject_FromVoidPtr(descriptor, NULL);
c49c04d
+#endif
c49c04d
       PyDict_SetItem(cache, key, obj);
c49c04d
       Py_DECREF(obj);
c49c04d
     }
c49c04d
@@ -2717,7 +2754,7 @@ static swig_module_info swig_module = {swig_types, 34, 0, 0, 0, 0};
c49c04d
 #endif
c49c04d
 #define SWIG_name    "_selinux"
c49c04d
 
c49c04d
-#define SWIGVERSION 0x010340 
c49c04d
+#define SWIGVERSION 0x020001 
c49c04d
 #define SWIG_VERSION SWIGVERSION
c49c04d
 
c49c04d
 
c49c04d
@@ -3345,7 +3382,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_avc_context_to_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_id_t *arg2 = (security_id_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -3360,7 +3397,7 @@ SWIGINTERN PyObject *_wrap_avc_context_to_sid(PyObject *SWIGUNUSEDPARM(self), Py
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:avc_context_to_sid",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   result = (int)avc_context_to_sid(arg1,arg2);
c49c04d
@@ -3383,7 +3420,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_avc_context_to_sid_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_id_t *arg2 = (security_id_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -3398,7 +3435,7 @@ SWIGINTERN PyObject *_wrap_avc_context_to_sid_raw(PyObject *SWIGUNUSEDPARM(self)
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:avc_context_to_sid_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "avc_context_to_sid_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   result = (int)avc_context_to_sid_raw(arg1,arg2);
c49c04d
@@ -5641,7 +5678,9 @@ SWIGINTERN PyObject *_wrap_get_ordered_context_list(PyObject *SWIGUNUSEDPARM(sel
c49c04d
     if (*arg3) {
c49c04d
       plist = PyList_New(result);
c49c04d
       for (i = 0; i < result; i++) {
c49c04d
-        PyList_SetItem(plist, i, PyString_FromString((*arg3)[i]));
c49c04d
+        PyList_SetItem(plist, i, 
c49c04d
+          PyBytes_FromString((*arg3)[i])
c49c04d
+          );
c49c04d
       }
c49c04d
     } else {
c49c04d
       plist = PyList_New(0);
c49c04d
@@ -5714,7 +5753,9 @@ SWIGINTERN PyObject *_wrap_get_ordered_context_list_with_level(PyObject *SWIGUNU
c49c04d
     if (*arg4) {
c49c04d
       plist = PyList_New(result);
c49c04d
       for (i = 0; i < result; i++) {
c49c04d
-        PyList_SetItem(plist, i, PyString_FromString((*arg4)[i]));
c49c04d
+        PyList_SetItem(plist, i, 
c49c04d
+          PyBytes_FromString((*arg4)[i])
c49c04d
+          );
c49c04d
       }
c49c04d
     } else {
c49c04d
       plist = PyList_New(0);
c49c04d
@@ -6390,7 +6431,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6400,7 +6441,7 @@ SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setcon",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6421,7 +6462,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6431,7 +6472,7 @@ SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setcon_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6650,7 +6691,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6660,7 +6701,7 @@ SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setexeccon",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6681,7 +6722,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6691,7 +6732,7 @@ SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObje
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setexeccon_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6772,7 +6813,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6782,7 +6823,7 @@ SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObje
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6803,7 +6844,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6813,7 +6854,7 @@ SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), Py
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6894,7 +6935,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6904,7 +6945,7 @@ SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObj
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -6925,7 +6966,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -6935,7 +6976,7 @@ SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), P
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -7016,7 +7057,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -7026,7 +7067,7 @@ SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyOb
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -7047,7 +7088,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -7057,7 +7098,7 @@ SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self),
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -8514,8 +8555,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_av(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   access_vector_t arg4 ;
c49c04d
   struct av_decision *arg5 = (struct av_decision *) 0 ;
c49c04d
@@ -8541,12 +8582,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av(PyObject *SWIGUNUSEDPARM(self), P
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8584,8 +8625,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_av_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   access_vector_t arg4 ;
c49c04d
   struct av_decision *arg5 = (struct av_decision *) 0 ;
c49c04d
@@ -8611,12 +8652,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av_raw(PyObject *SWIGUNUSEDPARM(self
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_raw",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_raw" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_raw" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8654,8 +8695,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_av_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   access_vector_t arg4 ;
c49c04d
   struct av_decision *arg5 = (struct av_decision *) 0 ;
c49c04d
@@ -8681,12 +8722,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av_flags(PyObject *SWIGUNUSEDPARM(se
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_flags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_flags" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_flags" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_flags" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_flags" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8724,8 +8765,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_av_flags_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   access_vector_t arg4 ;
c49c04d
   struct av_decision *arg5 = (struct av_decision *) 0 ;
c49c04d
@@ -8751,12 +8792,12 @@ SWIGINTERN PyObject *_wrap_security_compute_av_flags_raw(PyObject *SWIGUNUSEDPAR
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:security_compute_av_flags_raw",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_flags_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_av_flags_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_flags_raw" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_av_flags_raw" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8794,8 +8835,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   security_context_t *arg4 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -8816,12 +8857,12 @@ SWIGINTERN PyObject *_wrap_security_compute_create(PyObject *SWIGUNUSEDPARM(self
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create",&obj0,&obj1,&obj2)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8857,8 +8898,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_create_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   security_context_t *arg4 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -8879,12 +8920,12 @@ SWIGINTERN PyObject *_wrap_security_compute_create_raw(PyObject *SWIGUNUSEDPARM(
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_create_raw",&obj0,&obj1,&obj2)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_create_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create_raw" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_create_raw" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8920,8 +8961,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_relabel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   security_context_t *arg4 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -8942,12 +8983,12 @@ SWIGINTERN PyObject *_wrap_security_compute_relabel(PyObject *SWIGUNUSEDPARM(sel
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel",&obj0,&obj1,&obj2)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -8983,8 +9024,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_relabel_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   security_context_t *arg4 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -9005,12 +9046,12 @@ SWIGINTERN PyObject *_wrap_security_compute_relabel_raw(PyObject *SWIGUNUSEDPARM
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_relabel_raw",&obj0,&obj1,&obj2)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_relabel_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel_raw" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_relabel_raw" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -9046,8 +9087,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_member(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   security_context_t *arg4 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -9068,12 +9109,12 @@ SWIGINTERN PyObject *_wrap_security_compute_member(PyObject *SWIGUNUSEDPARM(self
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member",&obj0,&obj1,&obj2)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -9109,8 +9150,8 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_member_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
-  security_context_t arg2 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
+  security_context_t arg2 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_class_t arg3 ;
c49c04d
   security_context_t *arg4 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -9131,12 +9172,12 @@ SWIGINTERN PyObject *_wrap_security_compute_member_raw(PyObject *SWIGUNUSEDPARM(
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OOO:security_compute_member_raw",&obj0,&obj1,&obj2)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_member_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
   if (!SWIG_IsOK(res2)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member_raw" "', argument " "2"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_compute_member_raw" "', argument " "2"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg2 = (security_context_t)(buf2);
c49c04d
   ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3);
c49c04d
@@ -9172,7 +9213,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   char *arg2 = (char *) 0 ;
c49c04d
   security_context_t **arg3 = (security_context_t **) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -9192,7 +9233,7 @@ SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self),
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OO:security_compute_user",&obj0,&obj1)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
@@ -9217,7 +9258,9 @@ SWIGINTERN PyObject *_wrap_security_compute_user(PyObject *SWIGUNUSEDPARM(self),
c49c04d
       len++;
c49c04d
       plist = PyList_New(len);
c49c04d
       for (i = 0; i < len; i++) {
c49c04d
-        PyList_SetItem(plist, i, PyString_FromString((*arg3)[i]));
c49c04d
+        PyList_SetItem(plist, i, 
c49c04d
+          PyBytes_FromString((*arg3)[i])
c49c04d
+          );
c49c04d
       }
c49c04d
     } else {
c49c04d
       plist = PyList_New(0);
c49c04d
@@ -9243,7 +9286,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   char *arg2 = (char *) 0 ;
c49c04d
   security_context_t **arg3 = (security_context_t **) 0 ;
c49c04d
   int res1 ;
c49c04d
@@ -9263,7 +9306,7 @@ SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(se
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"OO:security_compute_user_raw",&obj0,&obj1)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_compute_user_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
c49c04d
@@ -9288,7 +9331,9 @@ SWIGINTERN PyObject *_wrap_security_compute_user_raw(PyObject *SWIGUNUSEDPARM(se
c49c04d
       len++;
c49c04d
       plist = PyList_New(len);
c49c04d
       for (i = 0; i < len; i++) {
c49c04d
-        PyList_SetItem(plist, i, PyString_FromString((*arg3)[i]));
c49c04d
+        PyList_SetItem(plist, i, 
c49c04d
+          PyBytes_FromString((*arg3)[i])
c49c04d
+          );
c49c04d
       }
c49c04d
     } else {
c49c04d
       plist = PyList_New(0);
c49c04d
@@ -9721,7 +9766,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -9731,7 +9776,7 @@ SWIGINTERN PyObject *_wrap_security_check_context(PyObject *SWIGUNUSEDPARM(self)
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:security_check_context",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -9752,7 +9797,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -9762,7 +9807,7 @@ SWIGINTERN PyObject *_wrap_security_check_context_raw(PyObject *SWIGUNUSEDPARM(s
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:security_check_context_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_check_context_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -9783,7 +9828,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_canonicalize_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_context_t *arg2 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -9796,7 +9841,7 @@ SWIGINTERN PyObject *_wrap_security_canonicalize_context(PyObject *SWIGUNUSEDPAR
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -9825,7 +9870,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_security_canonicalize_context_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_context_t *arg2 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -9838,7 +9883,7 @@ SWIGINTERN PyObject *_wrap_security_canonicalize_context_raw(PyObject *SWIGUNUSE
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:security_canonicalize_context_raw",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context_raw" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_canonicalize_context_raw" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -9994,7 +10039,7 @@ SWIGINTERN PyObject *_wrap_security_get_boolean_names(PyObject *SWIGUNUSEDPARM(s
c49c04d
     PyObject* list = PyList_New(*arg2);
c49c04d
     int i;
c49c04d
     for (i = 0; i < *arg2; i++) {
c49c04d
-      PyList_SetItem(list, i, PyString_FromString((*arg1)[i]));
c49c04d
+      PyList_SetItem(list, i, PyBytes_FromString((*arg1)[i]));
c49c04d
     }
c49c04d
     resultobj = SWIG_Python_AppendOutput(resultobj, list);
c49c04d
   }
c49c04d
@@ -11129,6 +11174,19 @@ fail:
c49c04d
 }
c49c04d
 
c49c04d
 
c49c04d
+SWIGINTERN PyObject *_wrap_selinux_sepgsql_context_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
+  PyObject *resultobj = 0;
c49c04d
+  char *result = 0 ;
c49c04d
+  
c49c04d
+  if (!PyArg_ParseTuple(args,(char *)":selinux_sepgsql_context_path")) SWIG_fail;
c49c04d
+  result = (char *)selinux_sepgsql_context_path();
c49c04d
+  resultobj = SWIG_FromCharPtr((const char *)result);
c49c04d
+  return resultobj;
c49c04d
+fail:
c49c04d
+  return NULL;
c49c04d
+}
c49c04d
+
c49c04d
+
c49c04d
 SWIGINTERN PyObject *_wrap_selinux_contexts_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
   char *result = 0 ;
c49c04d
@@ -11317,7 +11375,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -11327,7 +11385,7 @@ SWIGINTERN PyObject *_wrap_selinux_check_securetty_context(PyObject *SWIGUNUSEDP
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:selinux_check_securetty_context",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_check_securetty_context" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_check_securetty_context" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -11412,16 +11470,20 @@ SWIGINTERN PyObject *_wrap_rpm_execcon(PyObject *SWIGUNUSEDPARM(self), PyObject
c49c04d
     arg3 = (char**) malloc(size + 1);
c49c04d
     
c49c04d
     for(i = 0; i < size; i++) {
c49c04d
-      if (!PyString_Check(PySequence_GetItem(obj2, i))) {
c49c04d
-        PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings");
c49c04d
+      if (!PyBytes_Check(PySequence_GetItem(obj2, i))) {
c49c04d
+        PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
c49c04d
+        
c49c04d
         return NULL;
c49c04d
       }
c49c04d
+      
c49c04d
     }
c49c04d
     
c49c04d
     for(i = 0; i < size; i++) {
c49c04d
       s = PySequence_GetItem(obj2, i);
c49c04d
-      arg3[i] = (char*) malloc(PyString_Size(s) + 1);
c49c04d
-      strcpy(arg3[i], PyString_AsString(s));
c49c04d
+      
c49c04d
+      arg3[i] = (char*) malloc(PyBytes_Size(s) + 1);
c49c04d
+      strcpy(arg3[i], PyBytes_AsString(s));
c49c04d
+      
c49c04d
     }
c49c04d
     arg3[size] = NULL;
c49c04d
   }
c49c04d
@@ -11439,16 +11501,20 @@ SWIGINTERN PyObject *_wrap_rpm_execcon(PyObject *SWIGUNUSEDPARM(self), PyObject
c49c04d
     arg4 = (char**) malloc(size + 1);
c49c04d
     
c49c04d
     for(i = 0; i < size; i++) {
c49c04d
-      if (!PyString_Check(PySequence_GetItem(obj3, i))) {
c49c04d
-        PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings");
c49c04d
+      if (!PyBytes_Check(PySequence_GetItem(obj3, i))) {
c49c04d
+        PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
c49c04d
+        
c49c04d
         return NULL;
c49c04d
       }
c49c04d
+      
c49c04d
     }
c49c04d
     
c49c04d
     for(i = 0; i < size; i++) {
c49c04d
       s = PySequence_GetItem(obj3, i);
c49c04d
-      arg4[i] = (char*) malloc(PyString_Size(s) + 1);
c49c04d
-      strcpy(arg4[i], PyString_AsString(s));
c49c04d
+      
c49c04d
+      arg4[i] = (char*) malloc(PyBytes_Size(s) + 1);
c49c04d
+      strcpy(arg4[i], PyBytes_AsString(s));
c49c04d
+      
c49c04d
     }
c49c04d
     arg4[size] = NULL;
c49c04d
   }
c49c04d
@@ -11502,7 +11568,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
   int alloc1 = 0 ;
c49c04d
@@ -11512,7 +11578,7 @@ SWIGINTERN PyObject *_wrap_is_context_customizable(PyObject *SWIGUNUSEDPARM(self
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:is_context_customizable",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_context_customizable" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_context_customizable" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -11533,7 +11599,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_selinux_trans_to_raw_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_context_t *arg2 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -11546,7 +11612,7 @@ SWIGINTERN PyObject *_wrap_selinux_trans_to_raw_context(PyObject *SWIGUNUSEDPARM
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:selinux_trans_to_raw_context",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_trans_to_raw_context" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_trans_to_raw_context" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -11575,7 +11641,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_selinux_raw_to_trans_context(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   security_context_t *arg2 = (security_context_t *) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -11588,7 +11654,7 @@ SWIGINTERN PyObject *_wrap_selinux_raw_to_trans_context(PyObject *SWIGUNUSEDPARM
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_to_trans_context",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_to_trans_context" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_to_trans_context" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -11617,7 +11683,7 @@ fail:
c49c04d
 
c49c04d
 SWIGINTERN PyObject *_wrap_selinux_raw_context_to_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
c49c04d
   PyObject *resultobj = 0;
c49c04d
-  security_context_t arg1 = (security_context_t) 0 ;
c49c04d
+  security_context_t arg1 = (security_context_t) (security_context_t)0 ;
c49c04d
   char **arg2 = (char **) 0 ;
c49c04d
   int res1 ;
c49c04d
   char *buf1 = 0 ;
c49c04d
@@ -11630,7 +11696,7 @@ SWIGINTERN PyObject *_wrap_selinux_raw_context_to_color(PyObject *SWIGUNUSEDPARM
c49c04d
   if (!PyArg_ParseTuple(args,(char *)"O:selinux_raw_context_to_color",&obj0)) SWIG_fail;
c49c04d
   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
c49c04d
   if (!SWIG_IsOK(res1)) {
c49c04d
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_context_to_color" "', argument " "1"" of type '" "security_context_t""'");
c49c04d
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_context_to_color" "', argument " "1"" of type '" "security_context_t const""'");
c49c04d
   }
c49c04d
   arg1 = (security_context_t)(buf1);
c49c04d
   {
c49c04d
@@ -12172,6 +12238,7 @@ static PyMethodDef SwigMethods[] = {
c49c04d
 	 { (char *)"selinux_virtual_domain_context_path", _wrap_selinux_virtual_domain_context_path, METH_VARARGS, NULL},
c49c04d
 	 { (char *)"selinux_virtual_image_context_path", _wrap_selinux_virtual_image_context_path, METH_VARARGS, NULL},
c49c04d
 	 { (char *)"selinux_x_context_path", _wrap_selinux_x_context_path, METH_VARARGS, NULL},
c49c04d
+	 { (char *)"selinux_sepgsql_context_path", _wrap_selinux_sepgsql_context_path, METH_VARARGS, NULL},
c49c04d
 	 { (char *)"selinux_contexts_path", _wrap_selinux_contexts_path, METH_VARARGS, NULL},
c49c04d
 	 { (char *)"selinux_securetty_types_path", _wrap_selinux_securetty_types_path, METH_VARARGS, NULL},
c49c04d
 	 { (char *)"selinux_booleans_path", _wrap_selinux_booleans_path, METH_VARARGS, NULL},
c49c04d
@@ -12868,15 +12935,15 @@ extern "C" {
c49c04d
           }
c49c04d
         }
c49c04d
         if (ci) {
c49c04d
-          size_t shift = (ci->ptype) - types;
c49c04d
-          swig_type_info *ty = types_initial[shift];
c49c04d
-          size_t ldoc = (c - methods[i].ml_doc);
c49c04d
-          size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
c49c04d
-          char *ndoc = (char*)malloc(ldoc + lptr + 10);
c49c04d
-          if (ndoc) {
c49c04d
-            char *buff = ndoc;
c49c04d
-            void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
c49c04d
-            if (ptr) {
c49c04d
+          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
c49c04d
+          if (ptr) {
c49c04d
+            size_t shift = (ci->ptype) - types;
c49c04d
+            swig_type_info *ty = types_initial[shift];
c49c04d
+            size_t ldoc = (c - methods[i].ml_doc);
c49c04d
+            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
c49c04d
+            char *ndoc = (char*)malloc(ldoc + lptr + 10);
c49c04d
+            if (ndoc) {
c49c04d
+              char *buff = ndoc;
c49c04d
               strncpy(buff, methods[i].ml_doc, ldoc);
c49c04d
               buff += ldoc;
c49c04d
               strncpy(buff, "swig_ptr: ", 10);
c49c04d
@@ -14079,6 +14146,7 @@ SWIG_init(void) {
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_CTX_FILE",SWIG_From_int((int)(0)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_CTX_MEDIA",SWIG_From_int((int)(1)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_CTX_X",SWIG_From_int((int)(2)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_CTX_DB",SWIG_From_int((int)(3)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_OPT_UNUSED",SWIG_From_int((int)(0)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_OPT_VALIDATE",SWIG_From_int((int)(1)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_OPT_BASEONLY",SWIG_From_int((int)(2)));
c49c04d
@@ -14092,6 +14160,15 @@ SWIG_init(void) {
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_X_SELN",SWIG_From_int((int)(5)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_X_POLYPROP",SWIG_From_int((int)(6)));
c49c04d
   SWIG_Python_SetConstant(d, "SELABEL_X_POLYSELN",SWIG_From_int((int)(7)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_DATABASE",SWIG_From_int((int)(1)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_SCHEMA",SWIG_From_int((int)(2)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_TABLE",SWIG_From_int((int)(3)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_COLUMN",SWIG_From_int((int)(4)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_SEQUENCE",SWIG_From_int((int)(5)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_VIEW",SWIG_From_int((int)(6)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_PROCEDURE",SWIG_From_int((int)(7)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_BLOB",SWIG_From_int((int)(8)));
c49c04d
+  SWIG_Python_SetConstant(d, "SELABEL_DB_TUPLE",SWIG_From_int((int)(9)));
c49c04d
   SWIG_Python_SetConstant(d, "SELINUX_AVD_FLAGS_PERMISSIVE",SWIG_From_int((int)(0x0001)));
c49c04d
   SWIG_Python_SetConstant(d, "SELINUX_CB_LOG",SWIG_From_int((int)(0)));
c49c04d
   SWIG_Python_SetConstant(d, "SELINUX_CB_AUDIT",SWIG_From_int((int)(1)));