psss / rpms / libselinux

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