126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxconlist.8 libselinux-2.0.76/man/man8/selinuxconlist.8
6137b9
--- nsalibselinux/man/man8/selinuxconlist.8	1969-12-31 19:00:00.000000000 -0500
126f27
+++ libselinux-2.0.76/man/man8/selinuxconlist.8	2008-11-22 15:57:58.000000000 -0500
6137b9
@@ -0,0 +1,18 @@
6137b9
+.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
6137b9
+.SH "NAME"
6137b9
+selinuxconlist \- list all SELinux context reachable for user
6137b9
+.SH "SYNOPSIS"
6137b9
+.B selinuxconlist [-l level] user [context]
6137b9
+
6137b9
+.SH "DESCRIPTION"
6137b9
+.B selinuxconlist
6137b9
+reports the list of context reachable for user from the current context or specified context
6137b9
+
6137b9
+.B \-l level
6137b9
+mcs/mls level
6137b9
+
6137b9
+.SH AUTHOR	
6137b9
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
6137b9
+
6137b9
+.SH "SEE ALSO"
6137b9
+secon(8), selinuxdefcon(8)
126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/selinuxdefcon.8 libselinux-2.0.76/man/man8/selinuxdefcon.8
6137b9
--- nsalibselinux/man/man8/selinuxdefcon.8	1969-12-31 19:00:00.000000000 -0500
126f27
+++ libselinux-2.0.76/man/man8/selinuxdefcon.8	2008-11-22 15:57:58.000000000 -0500
6137b9
@@ -0,0 +1,19 @@
6137b9
+.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
6137b9
+.SH "NAME"
6137b9
+selinuxdefcon \- list default SELinux context for user 
6137b9
+
6137b9
+.SH "SYNOPSIS"
6137b9
+.B selinuxdefcon [-l level] user [fromcon]
6137b9
+
6137b9
+.SH "DESCRIPTION"
6137b9
+.B seconlist
6137b9
+reports the default context for the specified user from current context or specified context
6137b9
+
6137b9
+.B \-l level
6137b9
+mcs/mls level
6137b9
+
6137b9
+.SH AUTHOR	
6137b9
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
6137b9
+
6137b9
+.SH "SEE ALSO"
6137b9
+secon(8), selinuxconlist(8)
126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/src/callbacks.c libselinux-2.0.76/src/callbacks.c
b34511
--- nsalibselinux/src/callbacks.c	2008-08-28 09:34:24.000000000 -0400
126f27
+++ libselinux-2.0.76/src/callbacks.c	2008-11-22 15:57:58.000000000 -0500
94f8e1
@@ -16,6 +16,7 @@
88ff8b
 {
94f8e1
 	int rc;
94f8e1
 	va_list ap;
94f8e1
+	if (is_selinux_enabled() == 0) return 0;
94f8e1
 	va_start(ap, fmt);
94f8e1
 	rc = vfprintf(stderr, fmt, ap);
94f8e1
 	va_end(ap);
126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.76/src/matchpathcon.c
b34511
--- nsalibselinux/src/matchpathcon.c	2008-08-28 09:34:24.000000000 -0400
126f27
+++ libselinux-2.0.76/src/matchpathcon.c	2008-11-22 15:58:02.000000000 -0500
71cd13
@@ -2,6 +2,7 @@
71cd13
 #include <string.h>
71cd13
 #include <errno.h>
71cd13
 #include <stdio.h>
71cd13
+#include <syslog.h>
71cd13
 #include "selinux_internal.h"
71cd13
 #include "label_internal.h"
71cd13
 #include "callbacks.h"
0fa749
@@ -57,7 +58,7 @@
71cd13
 {
71cd13
 	va_list ap;
71cd13
 	va_start(ap, fmt);
71cd13
-	vfprintf(stderr, fmt, ap);
0fa749
+	vsyslog(LOG_ERR, fmt, ap);
71cd13
 	va_end(ap);
71cd13
 }
71cd13
 
126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinux.py libselinux-2.0.76/src/selinux.py
8a44c0
--- nsalibselinux/src/selinux.py	2008-08-28 09:34:24.000000000 -0400
126f27
+++ libselinux-2.0.76/src/selinux.py	2008-11-22 15:58:02.000000000 -0500
8a44c0
@@ -1,5 +1,5 @@
8a44c0
 # This file was automatically generated by SWIG (http://www.swig.org).
8a44c0
-# Version 1.3.33
8a44c0
+# Version 1.3.35
8a44c0
 #
8a44c0
 # Don't modify this file, modify the SWIG interface instead.
8a44c0
 # This file is compatible with both classic and new-style classes.
8a44c0
@@ -48,6 +48,29 @@
8a44c0
 del types
8a44c0
 
8a44c0
 
71a483
+import shutil, os, stat
8a44c0
+
8a44c0
+def restorecon(path, recursive=False):
8a44c0
+    """ Restore SELinux context on a given path """
8a44c0
+    mode = os.stat(path)[stat.ST_MODE]
8a44c0
+    status, context = matchpathcon(path, mode)
8a44c0
+    if status == 0:
8a44c0
+        lsetfilecon(path, context)
8a44c0
+        if recursive:
8a44c0
+            os.path.walk(path, lambda arg, dirname, fnames:
8a44c0
+                             map(restorecon, [os.path.join(dirname, fname)
9e66b8
+                                              for fname in fnames]), None)
8a44c0
+
8a44c0
+def copytree(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.copytree method """
8a44c0
+    shutil.copytree(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
8a44c0
+
8a44c0
+def install(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.move method """
8a44c0
+    shutil.move(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
8a44c0
+
8a44c0
 is_selinux_enabled = _selinux.is_selinux_enabled
8a44c0
 is_selinux_mls_enabled = _selinux.is_selinux_mls_enabled
8a44c0
 getcon = _selinux.getcon
126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libselinux-2.0.76/src/selinuxswig_python.i
8a44c0
--- nsalibselinux/src/selinuxswig_python.i	2008-08-28 09:34:24.000000000 -0400
126f27
+++ libselinux-2.0.76/src/selinuxswig_python.i	2008-11-22 15:58:02.000000000 -0500
8a44c0
@@ -6,6 +6,32 @@
8a44c0
 	#include "selinux/selinux.h"
8a44c0
 %}
8a44c0
 
8a44c0
+%pythoncode %{
8a44c0
+
c0fc19
+import shutil, os, stat
8a44c0
+
8a44c0
+def restorecon(path, recursive=False):
8a44c0
+    """ Restore SELinux context on a given path """
8a44c0
+    mode = os.stat(path)[stat.ST_MODE]
8a44c0
+    status, context = matchpathcon(path, mode)
8a44c0
+    if status == 0:
8a44c0
+        lsetfilecon(path, context)
8a44c0
+        if recursive:
8a44c0
+            os.path.walk(path, lambda arg, dirname, fnames:
8a44c0
+                             map(restorecon, [os.path.join(dirname, fname)
c0fc19
+                                              for fname in fnames]), None)
8a44c0
+
8a44c0
+def copytree(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.copytree method """
8a44c0
+    shutil.copytree(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
8a44c0
+
8a44c0
+def install(src, dest):
8a44c0
+    """ An SELinux-friendly shutil.move method """
8a44c0
+    shutil.move(src, dest)
8a44c0
+    restorecon(dest, recursive=True)
8a44c0
+%}
8a44c0
+
8a44c0
 /* security_get_boolean_names() typemap */
8a44c0
 %typemap(argout) (char ***names, int *len) {
8a44c0
 	PyObject* list = PyList_New(*$2);
126f27
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libselinux-2.0.76/src/selinuxswig_wrap.c
8a44c0
--- nsalibselinux/src/selinuxswig_wrap.c	2008-08-28 09:34:24.000000000 -0400
126f27
+++ libselinux-2.0.76/src/selinuxswig_wrap.c	2008-11-22 15:58:02.000000000 -0500
8a44c0
@@ -1,6 +1,6 @@
8a44c0
 /* ----------------------------------------------------------------------------
8a44c0
  * This file was automatically generated by SWIG (http://www.swig.org).
8a44c0
- * Version 1.3.33
8a44c0
+ * Version 1.3.35
8a44c0
  * 
8a44c0
  * This file is not intended to be easily readable and contains a number of 
8a44c0
  * coding conventions designed to improve portability and efficiency. Do not make
8a44c0
@@ -126,7 +126,7 @@
8a44c0
 
8a44c0
 /* This should only be incremented when either the layout of swig_type_info changes,
8a44c0
    or for whatever reason, the runtime changes incompatibly */
8a44c0
-#define SWIG_RUNTIME_VERSION "3"
8a44c0
+#define SWIG_RUNTIME_VERSION "4"
8a44c0
 
8a44c0
 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
8a44c0
 #ifdef SWIG_TYPE_TABLE
8a44c0
@@ -161,6 +161,7 @@
8a44c0
 
8a44c0
 /* Flags for pointer conversions */
8a44c0
 #define SWIG_POINTER_DISOWN        0x1
8a44c0
+#define SWIG_CAST_NEW_MEMORY       0x2
8a44c0
 
8a44c0
 /* Flags for new pointer objects */
8a44c0
 #define SWIG_POINTER_OWN           0x1
8a44c0
@@ -301,10 +302,10 @@
8a44c0
 extern "C" {
8a44c0
 #endif
8a44c0
 
8a44c0
-typedef void *(*swig_converter_func)(void *);
8a44c0
+typedef void *(*swig_converter_func)(void *, int *);
8a44c0
 typedef struct swig_type_info *(*swig_dycast_func)(void **);
8a44c0
 
8a44c0
-/* Structure to store inforomation on one type */
8a44c0
+/* Structure to store information on one type */
8a44c0
 typedef struct swig_type_info {
8a44c0
   const char             *name;			/* mangled name of this type */
8a44c0
   const char             *str;			/* human readable name of this type */
8a44c0
@@ -431,8 +432,8 @@
8a44c0
   Cast a pointer up an inheritance hierarchy
8a44c0
 */
8a44c0
 SWIGRUNTIMEINLINE void *
8a44c0
-SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
8a44c0
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
8a44c0
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
8a44c0
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
8a44c0
 }
8a44c0
 
8a44c0
 /* 
8a44c0
@@ -856,7 +857,7 @@
8a44c0
     Py_DECREF(old_str);
8a44c0
     Py_DECREF(value);
8a44c0
   } else {
8a44c0
-    PyErr_Format(PyExc_RuntimeError, mesg);
8a44c0
+    PyErr_SetString(PyExc_RuntimeError, mesg);
8a44c0
   }
8a44c0
 }
8a44c0
 
8a44c0
@@ -1416,7 +1417,7 @@
8a44c0
 {
8a44c0
   PySwigObject *sobj = (PySwigObject *) v;
8a44c0
   PyObject *next = sobj->next;
8a44c0
-  if (sobj->own) {
8a44c0
+  if (sobj->own == SWIG_POINTER_OWN) {
8a44c0
     swig_type_info *ty = sobj->ty;
8a44c0
     PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
8a44c0
     PyObject *destroy = data ? data->destroy : 0;
8a44c0
@@ -1434,12 +1435,13 @@
8a44c0
 	res = ((*meth)(mself, v));
8a44c0
       }
8a44c0
       Py_XDECREF(res);
8a44c0
-    } else {
8a44c0
-      const char *name = SWIG_TypePrettyName(ty);
8a44c0
+    } 
8a44c0
 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
8a44c0
-      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
8a44c0
-#endif
8a44c0
+    else {
8a44c0
+      const char *name = SWIG_TypePrettyName(ty);
8a44c0
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
8a44c0
     }
8a44c0
+#endif
8a44c0
   } 
8a44c0
   Py_XDECREF(next);
8a44c0
   PyObject_DEL(v);
8a44c0
@@ -1944,7 +1946,7 @@
8a44c0
 
8a44c0
 SWIGRUNTIME int
8a44c0
 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
8a44c0
-  if (own) {
8a44c0
+  if (own == SWIG_POINTER_OWN) {
8a44c0
     PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
8a44c0
     if (sobj) {
8a44c0
       int oldown = sobj->own;
8a44c0
@@ -1965,6 +1967,8 @@
8a44c0
     return SWIG_OK;
8a44c0
   } else {
8a44c0
     PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
8a44c0
+    if (own)
8a44c0
+      *own = 0;
8a44c0
     while (sobj) {
8a44c0
       void *vptr = sobj->ptr;
8a44c0
       if (ty) {
8a44c0
@@ -1978,7 +1982,15 @@
8a44c0
 	  if (!tc) {
8a44c0
 	    sobj = (PySwigObject *)sobj->next;
8a44c0
 	  } else {
8a44c0
-	    if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
8a44c0
+	    if (ptr) {
8a44c0
+              int newmemory = 0;
8a44c0
+              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
8a44c0
+              if (newmemory == SWIG_CAST_NEW_MEMORY) {
8a44c0
+                assert(own);
8a44c0
+                if (own)
8a44c0
+                  *own = *own | SWIG_CAST_NEW_MEMORY;
8a44c0
+              }
8a44c0
+            }
8a44c0
 	    break;
8a44c0
 	  }
8a44c0
 	}
8a44c0
@@ -1988,7 +2000,8 @@
8a44c0
       }
8a44c0
     }
8a44c0
     if (sobj) {
8a44c0
-      if (own) *own = sobj->own;
8a44c0
+      if (own)
8a44c0
+        *own = *own | sobj->own;
8a44c0
       if (flags & SWIG_POINTER_DISOWN) {
8a44c0
 	sobj->own = 0;
8a44c0
       }
8a44c0
@@ -2053,8 +2066,13 @@
8a44c0
     }
8a44c0
     if (ty) {
8a44c0
       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
8a44c0
-      if (!tc) return SWIG_ERROR;
8a44c0
-      *ptr = SWIG_TypeCast(tc,vptr);
8a44c0
+      if (tc) {
8a44c0
+        int newmemory = 0;
8a44c0
+        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
8a44c0
+        assert(!newmemory); /* newmemory handling not yet implemented */
8a44c0
+      } else {
8a44c0
+        return SWIG_ERROR;
8a44c0
+      }
8a44c0
     } else {
8a44c0
       *ptr = vptr;
8a44c0
     }
8a44c0
@@ -2506,7 +2524,7 @@
8a44c0
 
8a44c0
 #define SWIG_name    "_selinux"
8a44c0
 
8a44c0
-#define SWIGVERSION 0x010333 
8a44c0
+#define SWIGVERSION 0x010335 
8a44c0
 #define SWIG_VERSION SWIGVERSION
8a44c0
 
8a44c0
 
8a44c0
@@ -4273,7 +4291,7 @@
8a44c0
   struct av_decision *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_av_decision")) SWIG_fail;
8a44c0
-  result = (struct av_decision *)(struct av_decision *) calloc(1, sizeof(struct av_decision));
8a44c0
+  result = (struct av_decision *)calloc(1, sizeof(struct av_decision));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_av_decision, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -4305,7 +4323,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *av_decision_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_av_decision, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -4428,7 +4446,7 @@
8a44c0
   struct selinux_opt *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_selinux_opt")) SWIG_fail;
8a44c0
-  result = (struct selinux_opt *)(struct selinux_opt *) calloc(1, sizeof(struct selinux_opt));
8a44c0
+  result = (struct selinux_opt *)calloc(1, sizeof(struct selinux_opt));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_selinux_opt, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -4460,7 +4478,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *selinux_opt_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_selinux_opt, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -4626,7 +4644,7 @@
8a44c0
   union selinux_callback *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_selinux_callback")) SWIG_fail;
8a44c0
-  result = (union selinux_callback *)(union selinux_callback *) calloc(1, sizeof(union selinux_callback));
8a44c0
+  result = (union selinux_callback *)calloc(1, sizeof(union selinux_callback));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_selinux_callback, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -4658,7 +4676,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *selinux_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_selinux_callback, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -5586,7 +5604,7 @@
8a44c0
   SELboolean *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_SELboolean")) SWIG_fail;
8a44c0
-  result = (SELboolean *)(SELboolean *) calloc(1, sizeof(SELboolean));
8a44c0
+  result = (SELboolean *)calloc(1, sizeof(SELboolean));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SELboolean, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -5618,7 +5636,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *SELboolean_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_SELboolean, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -6139,7 +6157,7 @@
8a44c0
   struct security_class_mapping *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_security_class_mapping")) SWIG_fail;
8a44c0
-  result = (struct security_class_mapping *)(struct security_class_mapping *) calloc(1, sizeof(struct security_class_mapping));
8a44c0
+  result = (struct security_class_mapping *)calloc(1, sizeof(struct security_class_mapping));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_security_class_mapping, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -6171,7 +6189,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *security_class_mapping_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_security_class_mapping, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -7596,7 +7614,7 @@
8a44c0
   struct security_id *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_security_id")) SWIG_fail;
8a44c0
-  result = (struct security_id *)(struct security_id *) calloc(1, sizeof(struct security_id));
8a44c0
+  result = (struct security_id *)calloc(1, sizeof(struct security_id));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_security_id, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -7628,7 +7646,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *security_id_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_security_id, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -7915,7 +7933,7 @@
8a44c0
   struct avc_entry_ref *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_avc_entry_ref")) SWIG_fail;
8a44c0
-  result = (struct avc_entry_ref *)(struct avc_entry_ref *) calloc(1, sizeof(struct avc_entry_ref));
8a44c0
+  result = (struct avc_entry_ref *)calloc(1, sizeof(struct avc_entry_ref));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_entry_ref, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -7947,7 +7965,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *avc_entry_ref_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_avc_entry_ref, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -8061,7 +8079,7 @@
8a44c0
   struct avc_memory_callback *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_avc_memory_callback")) SWIG_fail;
8a44c0
-  result = (struct avc_memory_callback *)(struct avc_memory_callback *) calloc(1, sizeof(struct avc_memory_callback));
8a44c0
+  result = (struct avc_memory_callback *)calloc(1, sizeof(struct avc_memory_callback));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_memory_callback, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -8093,7 +8111,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *avc_memory_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_avc_memory_callback, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -8207,7 +8225,7 @@
8a44c0
   struct avc_log_callback *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_avc_log_callback")) SWIG_fail;
8a44c0
-  result = (struct avc_log_callback *)(struct avc_log_callback *) calloc(1, sizeof(struct avc_log_callback));
8a44c0
+  result = (struct avc_log_callback *)calloc(1, sizeof(struct avc_log_callback));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_log_callback, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -8239,7 +8257,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *avc_log_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_avc_log_callback, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -8353,7 +8371,7 @@
8a44c0
   struct avc_thread_callback *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_avc_thread_callback")) SWIG_fail;
8a44c0
-  result = (struct avc_thread_callback *)(struct avc_thread_callback *) calloc(1, sizeof(struct avc_thread_callback));
8a44c0
+  result = (struct avc_thread_callback *)calloc(1, sizeof(struct avc_thread_callback));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_thread_callback, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -8385,7 +8403,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *avc_thread_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_avc_thread_callback, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -8603,7 +8621,7 @@
8a44c0
   struct avc_lock_callback *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_avc_lock_callback")) SWIG_fail;
8a44c0
-  result = (struct avc_lock_callback *)(struct avc_lock_callback *) calloc(1, sizeof(struct avc_lock_callback));
8a44c0
+  result = (struct avc_lock_callback *)calloc(1, sizeof(struct avc_lock_callback));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_lock_callback, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -8635,7 +8653,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *avc_lock_callback_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_avc_lock_callback, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -9493,7 +9511,7 @@
8a44c0
   struct avc_cache_stats *result = 0 ;
8a44c0
   
8a44c0
   if (!PyArg_ParseTuple(args,(char *)":new_avc_cache_stats")) SWIG_fail;
8a44c0
-  result = (struct avc_cache_stats *)(struct avc_cache_stats *) calloc(1, sizeof(struct avc_cache_stats));
8a44c0
+  result = (struct avc_cache_stats *)calloc(1, sizeof(struct avc_cache_stats));
8a44c0
   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_avc_cache_stats, SWIG_POINTER_NEW |  0 );
8a44c0
   return resultobj;
8a44c0
 fail:
8a44c0
@@ -9525,7 +9543,7 @@
8a44c0
 
8a44c0
 SWIGINTERN PyObject *avc_cache_stats_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8a44c0
   PyObject *obj;
8a44c0
-  if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
8a44c0
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8a44c0
   SWIG_TypeNewClientData(SWIGTYPE_p_avc_cache_stats, SWIG_NewClientData(obj));
8a44c0
   return SWIG_Py_Void();
8a44c0
 }
8a44c0
@@ -10513,7 +10531,7 @@
8a44c0
 SWIG_InitializeModule(void *clientdata) {
8a44c0
   size_t i;
8a44c0
   swig_module_info *module_head, *iter;
8a44c0
-  int found;
8a44c0
+  int found, init;
8a44c0
   
8a44c0
   clientdata = clientdata;
8a44c0
   
8a44c0
@@ -10523,6 +10541,9 @@
8a44c0
     swig_module.type_initial = swig_type_initial;
8a44c0
     swig_module.cast_initial = swig_cast_initial;
8a44c0
     swig_module.next = &swig_module;
8a44c0
+    init = 1;
8a44c0
+  } else {
8a44c0
+    init = 0;
8a44c0
   }
8a44c0
   
8a44c0
   /* Try and load any already created modules */
8a44c0
@@ -10551,6 +10572,12 @@
8a44c0
     module_head->next = &swig_module;
8a44c0
   }
8a44c0
   
8a44c0
+  /* When multiple interpeters are used, a module could have already been initialized in
8a44c0
+       a different interpreter, but not yet have a pointer in this interpreter.
8a44c0
+       In this case, we do not want to continue adding types... everything should be
8a44c0
+       set up already */
8a44c0
+  if (init == 0) return;
8a44c0
+  
8a44c0
   /* Now work on filling in swig_module.types */
8a44c0
 #ifdef SWIGRUNTIME_DEBUG
8a44c0
   printf("SWIG_InitializeModule: size %d\n", swig_module.size);