| 
      
      
      From: <ssm...@us...> - 2007-02-21 17:02:26
      
     | 
| Revision: 2243
          http://svn.sourceforge.net/selinux/?rev=2243&view=rev
Author:   ssmalley
Date:     2007-02-21 09:02:11 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Author: Daniel J Walsh
Email: dw...@re...
Subject: libselinux patch
Date: Tue, 20 Feb 2007 09:31:00 -0500
This patch initializes all swig parameters to prevent possible crashes 
in python.
Modified Paths:
--------------
    trunk/libselinux/src/selinux.py
    trunk/libselinux/src/selinuxswig.i
    trunk/libselinux/src/selinuxswig_wrap.c
Modified: trunk/libselinux/src/selinux.py
===================================================================
--- trunk/libselinux/src/selinux.py	2007-02-20 14:06:53 UTC (rev 2242)
+++ trunk/libselinux/src/selinux.py	2007-02-21 17:02:11 UTC (rev 2243)
@@ -1,10 +1,16 @@
-# This file was created automatically by SWIG 1.3.29.
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.31
+#
 # Don't modify this file, modify the SWIG interface instead.
 # This file is compatible with both classic and new-style classes.
 
 import _selinux
 import new
 new_instancemethod = new.instancemethod
+try:
+    _swig_property = property
+except NameError:
+    pass # Python < 2.2 doesn't have 'property'.
 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
Modified: trunk/libselinux/src/selinuxswig.i
===================================================================
--- trunk/libselinux/src/selinuxswig.i	2007-02-20 14:06:53 UTC (rev 2242)
+++ trunk/libselinux/src/selinuxswig.i	2007-02-21 17:02:11 UTC (rev 2243)
@@ -28,7 +28,7 @@
 %typemap(in, numinputs=0) security_context_t *(security_context_t temp=NULL) {
 	$1 = &temp;
 }
-%typemap(argout) security_context_t * (char *temp) {
+%typemap(argout) security_context_t * (char *temp=NULL) {
 	if (*$1)
 		temp = *$1;
 	else
@@ -126,7 +126,7 @@
 extern int selinux_raw_to_trans_context(char *raw, 
 					security_context_t *transp);
 
-%typemap(in, numinputs=0) char **(char *temp) {
+%typemap(in, numinputs=0) char **(char *temp=NULL) {
 	$1 = &temp;
 }
 
Modified: trunk/libselinux/src/selinuxswig_wrap.c
===================================================================
--- trunk/libselinux/src/selinuxswig_wrap.c	2007-02-20 14:06:53 UTC (rev 2242)
+++ trunk/libselinux/src/selinuxswig_wrap.c	2007-02-21 17:02:11 UTC (rev 2243)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.29
+ * Version 1.3.31
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -103,7 +103,7 @@
 #endif
 
 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
 # define _CRT_SECURE_NO_DEPRECATE
 #endif
 
@@ -120,7 +120,7 @@
 
 /* This should only be incremented when either the layout of swig_type_info changes,
    or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "2"
+#define SWIG_RUNTIME_VERSION "3"
 
 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 #ifdef SWIG_TYPE_TABLE
@@ -697,8 +697,6 @@
 
 
 
-/* Python.h has to appear first */
-#include <Python.h>
 
 /* Add PyOS_snprintf for old Pythons */
 #if PY_VERSION_HEX < 0x02020000
@@ -779,6 +777,14 @@
 }
 #endif
 
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+#endif
 
 /* -----------------------------------------------------------------------------
  * error manipulation
@@ -1172,7 +1178,7 @@
 SWIGRUNTIMEINLINE PyObject * 
 _SWIG_Py_None(void)
 {
-  PyObject *none = Py_BuildValue("");
+  PyObject *none = Py_BuildValue((char*)"");
   Py_DECREF(none);
   return none;
 }
@@ -2031,7 +2037,7 @@
     void *vptr = 0;
     
     /* here we get the method pointer for callbacks */
-    char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
     if (desc) {
       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
@@ -2152,7 +2158,7 @@
    return;
  }
 #endif
- dict = PyObject_GetAttrString(inst, "__dict__");
+ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
  PyDict_SetItem(dict, SWIG_This(), swig_this);
  Py_DECREF(dict);
 } 
@@ -2293,7 +2299,7 @@
 
 /* The python cached type query */
 SWIGRUNTIME PyObject *
-SWIG_Python_TypeCache() {
+SWIG_Python_TypeCache(void) {
   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
   return cache;
 }
@@ -2459,7 +2465,7 @@
 
 #if (PY_VERSION_HEX <= 0x02000000)
 # if !defined(SWIG_PYTHON_CLASSIC)
-#  error "This python version requires to use swig with the '-classic' option"
+#  error "This python version requires swig to be run with the '-classic' option"
 # endif
 #endif
 
@@ -2470,7 +2476,8 @@
 
 #define SWIG_name    "_selinux"
 
-#define SWIGVERSION 0x010329 
+#define SWIGVERSION 0x010331 
+#define SWIG_VERSION SWIGVERSION
 
 
 #define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
@@ -2638,7 +2645,7 @@
 
 
 SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor()
+SWIG_pchar_descriptor(void)
 {
   static int init = 0;
   static swig_type_info* info = 0;
@@ -2654,7 +2661,7 @@
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
   if (PyString_Check(obj)) {
-    char *cstr; int len;
+    char *cstr; Py_ssize_t len;
     PyString_AsStringAndSize(obj, &cstr, &len);
     if (cptr)  {
       if (alloc) {
@@ -2832,7 +2839,7 @@
   security_context_t *arg1 = (security_context_t *) 0 ;
   int result;
   security_context_t temp1 = NULL ;
-  char *temp10 ;
+  char *temp10 = NULL ;
   
   {
     arg1 = &temp1;
@@ -2879,7 +2886,7 @@
   int val1 ;
   int ecode1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -2911,7 +2918,7 @@
   security_context_t *arg1 = (security_context_t *) 0 ;
   int result;
   security_context_t temp1 = NULL ;
-  char *temp10 ;
+  char *temp10 = NULL ;
   
   {
     arg1 = &temp1;
@@ -2937,7 +2944,7 @@
   security_context_t *arg1 = (security_context_t *) 0 ;
   int result;
   security_context_t temp1 = NULL ;
-  char *temp10 ;
+  char *temp10 = NULL ;
   
   {
     arg1 = &temp1;
@@ -2981,7 +2988,7 @@
   security_context_t *arg1 = (security_context_t *) 0 ;
   int result;
   security_context_t temp1 = NULL ;
-  char *temp10 ;
+  char *temp10 = NULL ;
   
   {
     arg1 = &temp1;
@@ -3025,7 +3032,7 @@
   security_context_t *arg1 = (security_context_t *) 0 ;
   int result;
   security_context_t temp1 = NULL ;
-  char *temp10 ;
+  char *temp10 = NULL ;
   
   {
     arg1 = &temp1;
@@ -3069,7 +3076,7 @@
   security_context_t *arg1 = (security_context_t *) 0 ;
   int result;
   security_context_t temp1 = NULL ;
-  char *temp10 ;
+  char *temp10 = NULL ;
   
   {
     arg1 = &temp1;
@@ -3117,7 +3124,7 @@
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -3128,7 +3135,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getfilecon" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)getfilecon((char const *)arg1,arg2);
   resultobj = SWIG_From_int((int)(result));
   {
@@ -3155,7 +3162,7 @@
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -3166,7 +3173,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lgetfilecon" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)lgetfilecon((char const *)arg1,arg2);
   resultobj = SWIG_From_int((int)(result));
   {
@@ -3192,7 +3199,7 @@
   int val1 ;
   int ecode1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -3235,7 +3242,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfilecon" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   {
     arg2 = (security_context_t)PyString_AsString(obj1);
   }
@@ -3265,7 +3272,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lsetfilecon" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   {
     arg2 = (security_context_t)PyString_AsString(obj1);
   }
@@ -3314,7 +3321,7 @@
   int val1 ;
   int ecode1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -3440,7 +3447,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_load_booleans" "', argument " "1"" of type '" "char *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)security_load_booleans(arg1);
   resultobj = SWIG_From_int((int)(result));
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
@@ -3475,7 +3482,7 @@
   security_context_t *arg2 = (security_context_t *) 0 ;
   int result;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -3594,7 +3601,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_boolean_pending" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)security_get_boolean_pending((char const *)arg1);
   resultobj = SWIG_From_int((int)(result));
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
@@ -3619,7 +3626,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_get_boolean_active" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)security_get_boolean_active((char const *)arg1);
   resultobj = SWIG_From_int((int)(result));
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
@@ -3648,7 +3655,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_set_boolean" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   ecode2 = SWIG_AsVal_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "security_set_boolean" "', argument " "2"" of type '" "int""'");
@@ -3712,7 +3719,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon_init" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)matchpathcon_init((char const *)arg1);
   resultobj = SWIG_From_int((int)(result));
   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
@@ -3735,7 +3742,7 @@
   unsigned int val2 ;
   int ecode2 = 0 ;
   security_context_t temp3 = NULL ;
-  char *temp30 ;
+  char *temp30 = NULL ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   
@@ -3747,7 +3754,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchpathcon" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matchpathcon" "', argument " "2"" of type '" "mode_t""'");
@@ -3779,7 +3786,7 @@
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -3790,7 +3797,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "matchmediacon" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)matchmediacon((char const *)arg1,arg2);
   resultobj = SWIG_From_int((int)(result));
   {
@@ -3837,7 +3844,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_policy_root")) SWIG_fail;
   result = (char *)selinux_policy_root();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3850,7 +3857,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_binary_policy_path")) SWIG_fail;
   result = (char *)selinux_binary_policy_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3863,7 +3870,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_failsafe_context_path")) SWIG_fail;
   result = (char *)selinux_failsafe_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3876,7 +3883,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_removable_context_path")) SWIG_fail;
   result = (char *)selinux_removable_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3889,7 +3896,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_default_context_path")) SWIG_fail;
   result = (char *)selinux_default_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3902,7 +3909,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_user_contexts_path")) SWIG_fail;
   result = (char *)selinux_user_contexts_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3915,7 +3922,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_path")) SWIG_fail;
   result = (char *)selinux_file_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3928,7 +3935,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_homedir_path")) SWIG_fail;
   result = (char *)selinux_file_context_homedir_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3941,7 +3948,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_file_context_local_path")) SWIG_fail;
   result = (char *)selinux_file_context_local_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3954,7 +3961,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_homedir_context_path")) SWIG_fail;
   result = (char *)selinux_homedir_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3967,7 +3974,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_media_context_path")) SWIG_fail;
   result = (char *)selinux_media_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3980,7 +3987,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_contexts_path")) SWIG_fail;
   result = (char *)selinux_contexts_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -3993,7 +4000,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_booleans_path")) SWIG_fail;
   result = (char *)selinux_booleans_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4006,7 +4013,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_customizable_types_path")) SWIG_fail;
   result = (char *)selinux_customizable_types_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4019,7 +4026,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_users_path")) SWIG_fail;
   result = (char *)selinux_users_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4032,7 +4039,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_usersconf_path")) SWIG_fail;
   result = (char *)selinux_usersconf_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4045,7 +4052,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_translations_path")) SWIG_fail;
   result = (char *)selinux_translations_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4058,7 +4065,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_netfilter_context_path")) SWIG_fail;
   result = (char *)selinux_netfilter_context_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4071,7 +4078,7 @@
   
   if (!PyArg_ParseTuple(args,(char *)":selinux_path")) SWIG_fail;
   result = (char *)selinux_path();
-  resultobj = SWIG_FromCharPtr(result);
+  resultobj = SWIG_FromCharPtr((const char *)result);
   return resultobj;
 fail:
   return NULL;
@@ -4165,7 +4172,7 @@
   if (!SWIG_IsOK(res2)) {
     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rpm_execcon" "', argument " "2"" of type '" "char const *""'");
   }
-  arg2 = buf2;
+  arg2 = (char *)(buf2);
   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_p_char, 0 |  0 );
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rpm_execcon" "', argument " "3"" of type '" "char *const []""'"); 
@@ -4213,7 +4220,7 @@
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -4224,7 +4231,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_trans_to_raw_context" "', argument " "1"" of type '" "char *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)selinux_trans_to_raw_context(arg1,arg2);
   resultobj = SWIG_From_int((int)(result));
   {
@@ -4251,7 +4258,7 @@
   char *buf1 = 0 ;
   int alloc1 = 0 ;
   security_context_t temp2 = NULL ;
-  char *temp20 ;
+  char *temp20 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -4262,7 +4269,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "selinux_raw_to_trans_context" "', argument " "1"" of type '" "char *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)selinux_raw_to_trans_context(arg1,arg2);
   resultobj = SWIG_From_int((int)(result));
   {
@@ -4284,7 +4291,7 @@
   PyObject *resultobj = 0;
   char **arg1 = (char **) 0 ;
   int result;
-  char *temp1 ;
+  char *temp1 = NULL ;
   
   {
     arg1 = &temp1;
@@ -4310,8 +4317,8 @@
   int res1 ;
   char *buf1 = 0 ;
   int alloc1 = 0 ;
-  char *temp2 ;
-  char *temp3 ;
+  char *temp2 = NULL ;
+  char *temp3 = NULL ;
   PyObject * obj0 = 0 ;
   
   {
@@ -4325,7 +4332,7 @@
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getseuserbyname" "', argument " "1"" of type '" "char const *""'");
   }
-  arg1 = buf1;
+  arg1 = (char *)(buf1);
   result = (int)getseuserbyname((char const *)arg1,arg2,arg3);
   resultobj = SWIG_From_int((int)(result));
   {
@@ -4479,7 +4486,7 @@
  * structures together.
  *
  * The generated swig_type_info structures are assigned staticly to an initial 
- * array. We just loop though that array, and handle each type individually.
+ * array. We just loop through that array, and handle each type individually.
  * First we lookup if this type has been already loaded, and if so, use the
  * loaded structure instead of the generated one. Then we have to fill in the
  * cast linked list. The cast data is initially stored in something like a
@@ -4517,30 +4524,47 @@
 #define SWIGRUNTIME_DEBUG
 #endif
 
+
 SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
-  swig_module_info *module_head;
-  static int init_run = 0;
+  swig_module_info *module_head, *iter;
+  int found;
   
   clientdata = clientdata;
   
-  if (init_run) return;
-  init_run = 1;
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
   
-  /* Initialize the swig_module */
-  swig_module.type_initial = swig_type_initial;
-  swig_module.cast_initial = swig_cast_initial;
-  
   /* Try and load any already created modules */
   module_head = SWIG_GetModule(clientdata);
-  if (module_head) {
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
     swig_module.next = module_head->next;
     module_head->next = &swig_module;
-  } else {
-    /* This is the first module loaded */
-    swig_module.next = &swig_module;
-    SWIG_SetModule(clientdata, &swig_module);
   }
   
   /* Now work on filling in swig_module.types */
@@ -4853,7 +4877,7 @@
   }
   
   SWIGINTERN PyObject *
-  SWIG_globals() {
+  SWIG_globals(void) {
     static PyObject *_SWIG_globals = 0; 
     if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
     return _SWIG_globals;
@@ -4898,11 +4922,11 @@
     swig_type_info **types_initial) {
     size_t i;
     for (i = 0; methods[i].ml_name; ++i) {
-      char *c = methods[i].ml_doc;
+      const char *c = methods[i].ml_doc;
       if (c && (c = strstr(c, "swig_ptr: "))) {
         int j;
         swig_const_info *ci = 0;
-        char *name = c + 10;
+        const char *name = c + 10;
         for (j = 0; const_table[j].type; ++j) {
           if (strncmp(const_table[j].name, name, 
               strlen(const_table[j].name)) == 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |