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