From: <ssm...@us...> - 2007-01-26 21:04:36
|
Revision: 2208 http://svn.sourceforge.net/selinux/?rev=2208&view=rev Author: ssmalley Date: 2007-01-26 13:04:34 -0800 (Fri, 26 Jan 2007) Log Message: ----------- libselinux and libsemanage: ported r2207 from trunk. Modified Paths: -------------- branches/stable/1_0/libselinux/ChangeLog branches/stable/1_0/libselinux/VERSION branches/stable/1_0/libselinux/src/selinuxswig.i branches/stable/1_0/libselinux/src/selinuxswig_wrap.c branches/stable/1_0/libsemanage/ChangeLog branches/stable/1_0/libsemanage/VERSION branches/stable/1_0/libsemanage/src/semanageswig_python.i branches/stable/1_0/libsemanage/src/semanageswig_wrap.c Modified: branches/stable/1_0/libselinux/ChangeLog =================================================================== --- branches/stable/1_0/libselinux/ChangeLog 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libselinux/ChangeLog 2007-01-26 21:04:34 UTC (rev 2208) @@ -1,3 +1,6 @@ +1.34.1 2007-01-26 + * Merged python binding fixes from Dan Walsh. + 1.34.0 2007-01-18 * Updated version for stable branch. Modified: branches/stable/1_0/libselinux/VERSION =================================================================== --- branches/stable/1_0/libselinux/VERSION 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libselinux/VERSION 2007-01-26 21:04:34 UTC (rev 2208) @@ -1 +1 @@ -1.34.0 +1.34.1 Modified: branches/stable/1_0/libselinux/src/selinuxswig.i =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig.i 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libselinux/src/selinuxswig.i 2007-01-26 21:04:34 UTC (rev 2208) @@ -25,7 +25,7 @@ %apply int *OUTPUT { int * }; %apply int *OUTPUT { size_t * }; -%typemap(in, numinputs=0) security_context_t *(security_context_t temp) { +%typemap(in, numinputs=0) security_context_t *(security_context_t temp=NULL) { $1 = &temp; } %typemap(argout) security_context_t * (char *temp) { Modified: branches/stable/1_0/libselinux/src/selinuxswig_wrap.c =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-01-26 21:04:34 UTC (rev 2208) @@ -2831,7 +2831,7 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 ; + security_context_t temp1 = NULL ; char *temp10 ; { @@ -2878,7 +2878,7 @@ int result; int val1 ; int ecode1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -2910,7 +2910,7 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 ; + security_context_t temp1 = NULL ; char *temp10 ; { @@ -2936,7 +2936,7 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 ; + security_context_t temp1 = NULL ; char *temp10 ; { @@ -2980,7 +2980,7 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 ; + security_context_t temp1 = NULL ; char *temp10 ; { @@ -3024,7 +3024,7 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 ; + security_context_t temp1 = NULL ; char *temp10 ; { @@ -3068,7 +3068,7 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 ; + security_context_t temp1 = NULL ; char *temp10 ; { @@ -3116,7 +3116,7 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -3154,7 +3154,7 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -3191,7 +3191,7 @@ int result; int val1 ; int ecode1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -3313,7 +3313,7 @@ int result; int val1 ; int ecode1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -3474,7 +3474,7 @@ security_context_t arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; int result; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -3734,7 +3734,7 @@ int alloc1 = 0 ; unsigned int val2 ; int ecode2 = 0 ; - security_context_t temp3 ; + security_context_t temp3 = NULL ; char *temp30 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -3778,7 +3778,7 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -4212,7 +4212,7 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; @@ -4250,7 +4250,7 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 ; + security_context_t temp2 = NULL ; char *temp20 ; PyObject * obj0 = 0 ; Modified: branches/stable/1_0/libsemanage/ChangeLog =================================================================== --- branches/stable/1_0/libsemanage/ChangeLog 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libsemanage/ChangeLog 2007-01-26 21:04:34 UTC (rev 2208) @@ -1,3 +1,6 @@ +1.10.1 2007-01-26 + * Merged python binding fix from Dan Walsh. + 1.10.0 2007-01-18 * Updated version for stable branch. Modified: branches/stable/1_0/libsemanage/VERSION =================================================================== --- branches/stable/1_0/libsemanage/VERSION 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libsemanage/VERSION 2007-01-26 21:04:34 UTC (rev 2208) @@ -1 +1 @@ -1.10.0 +1.10.1 Modified: branches/stable/1_0/libsemanage/src/semanageswig_python.i =================================================================== --- branches/stable/1_0/libsemanage/src/semanageswig_python.i 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libsemanage/src/semanageswig_python.i 2007-01-26 21:04:34 UTC (rev 2208) @@ -99,7 +99,7 @@ %apply int *OUTPUT { size_t * }; %apply int *OUTPUT { unsigned int * }; -%typemap(in, numinputs=0) char **(char *temp) { +%typemap(in, numinputs=0) char **(char *temp=NULL) { $1 = &temp; } @@ -108,7 +108,7 @@ free(*$1); } -%typemap(in, numinputs=0) char ***(char **temp) { +%typemap(in, numinputs=0) char ***(char **temp=NULL) { $1 = &temp; } @@ -136,7 +136,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_module_info_t ** parameter */ -%typemap(in, numinputs=0) semanage_module_info_t **(semanage_module_info_t *temp) { +%typemap(in, numinputs=0) semanage_module_info_t **(semanage_module_info_t *temp=NULL) { $1 = &temp; } @@ -148,7 +148,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_context_t ** parameter */ -%typemap(in, numinputs=0) semanage_context_t **(semanage_context_t *temp) { +%typemap(in, numinputs=0) semanage_context_t **(semanage_context_t *temp=NULL) { $1 = &temp; } @@ -160,7 +160,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_bool_t *** parameter */ -%typemap(in, numinputs=0) semanage_bool_t ***(semanage_bool_t **temp) { +%typemap(in, numinputs=0) semanage_bool_t ***(semanage_bool_t **temp=NULL) { $1 = &temp; } @@ -183,7 +183,7 @@ } } -%typemap(in, numinputs=0) semanage_bool_t **(semanage_bool_t *temp) { +%typemap(in, numinputs=0) semanage_bool_t **(semanage_bool_t *temp=NULL) { $1 = &temp; } @@ -195,7 +195,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_bool_key_t **(semanage_bool_key_t *temp) { +%typemap(in, numinputs=0) semanage_bool_key_t **(semanage_bool_key_t *temp=NULL) { $1 = &temp; } @@ -203,7 +203,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_fcontext_t *** parameter */ -%typemap(in, numinputs=0) semanage_fcontext_t ***(semanage_fcontext_t **temp) { +%typemap(in, numinputs=0) semanage_fcontext_t ***(semanage_fcontext_t **temp=NULL) { $1 = &temp; } @@ -226,7 +226,7 @@ } } -%typemap(in, numinputs=0) semanage_fcontext_t **(semanage_fcontext_t *temp) { +%typemap(in, numinputs=0) semanage_fcontext_t **(semanage_fcontext_t *temp=NULL) { $1 = &temp; } @@ -238,7 +238,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_fcontext_key_t **(semanage_fcontext_key_t *temp) { +%typemap(in, numinputs=0) semanage_fcontext_key_t **(semanage_fcontext_key_t *temp=NULL) { $1 = &temp; } @@ -246,7 +246,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_iface_t *** parameter */ -%typemap(in, numinputs=0) semanage_iface_t ***(semanage_iface_t **temp) { +%typemap(in, numinputs=0) semanage_iface_t ***(semanage_iface_t **temp=NULL) { $1 = &temp; } @@ -270,7 +270,7 @@ } } -%typemap(in, numinputs=0) semanage_iface_t **(semanage_iface_t *temp) { +%typemap(in, numinputs=0) semanage_iface_t **(semanage_iface_t *temp=NULL) { $1 = &temp; } @@ -282,7 +282,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_iface_key_t **(semanage_iface_key_t *temp) { +%typemap(in, numinputs=0) semanage_iface_key_t **(semanage_iface_key_t *temp=NULL) { $1 = &temp; } @@ -290,7 +290,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_seuser_t *** parameter */ -%typemap(in, numinputs=0) semanage_seuser_t ***(semanage_seuser_t **temp) { +%typemap(in, numinputs=0) semanage_seuser_t ***(semanage_seuser_t **temp=NULL) { $1 = &temp; } @@ -314,7 +314,7 @@ } } -%typemap(in, numinputs=0) semanage_seuser_t **(semanage_seuser_t *temp) { +%typemap(in, numinputs=0) semanage_seuser_t **(semanage_seuser_t *temp=NULL) { $1 = &temp; } @@ -326,7 +326,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_seuser_key_t **(semanage_seuser_key_t *temp) { +%typemap(in, numinputs=0) semanage_seuser_key_t **(semanage_seuser_key_t *temp=NULL) { $1 = &temp; } @@ -334,7 +334,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_user_t *** parameter */ -%typemap(in, numinputs=0) semanage_user_t ***(semanage_user_t **temp) { +%typemap(in, numinputs=0) semanage_user_t ***(semanage_user_t **temp=NULL) { $1 = &temp; } @@ -357,7 +357,7 @@ } } -%typemap(in, numinputs=0) semanage_user_t **(semanage_user_t *temp) { +%typemap(in, numinputs=0) semanage_user_t **(semanage_user_t *temp=NULL) { $1 = &temp; } @@ -369,7 +369,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_user_key_t **(semanage_user_key_t *temp) { +%typemap(in, numinputs=0) semanage_user_key_t **(semanage_user_key_t *temp=NULL) { $1 = &temp; } @@ -377,7 +377,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_port_t *** parameter */ -%typemap(in, numinputs=0) semanage_port_t ***(semanage_port_t **temp) { +%typemap(in, numinputs=0) semanage_port_t ***(semanage_port_t **temp=NULL) { $1 = &temp; } @@ -400,7 +400,7 @@ } } -%typemap(in, numinputs=0) semanage_port_t **(semanage_port_t *temp) { +%typemap(in, numinputs=0) semanage_port_t **(semanage_port_t *temp=NULL) { $1 = &temp; } @@ -412,7 +412,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_port_key_t **(semanage_port_key_t *temp) { +%typemap(in, numinputs=0) semanage_port_key_t **(semanage_port_key_t *temp=NULL) { $1 = &temp; } @@ -420,7 +420,7 @@ /* the wrapper will setup this parameter for passing... the resulting python functions will not take the semanage_node_t *** parameter */ -%typemap(in, numinputs=0) semanage_node_t ***(semanage_node_t **temp) { +%typemap(in, numinputs=0) semanage_node_t ***(semanage_node_t **temp=NULL) { $1 = &temp; } @@ -443,7 +443,7 @@ } } -%typemap(in, numinputs=0) semanage_node_t **(semanage_node_t *temp) { +%typemap(in, numinputs=0) semanage_node_t **(semanage_node_t *temp=NULL) { $1 = &temp; } @@ -456,7 +456,7 @@ $result = SWIG_Python_AppendOutput($result, SWIG_NewPointerObj(*$1, $*1_descriptor, 0)); } -%typemap(in, numinputs=0) semanage_node_key_t **(semanage_node_key_t *temp) { +%typemap(in, numinputs=0) semanage_node_key_t **(semanage_node_key_t *temp=NULL) { $1 = &temp; } Modified: branches/stable/1_0/libsemanage/src/semanageswig_wrap.c =================================================================== --- branches/stable/1_0/libsemanage/src/semanageswig_wrap.c 2007-01-26 20:55:38 UTC (rev 2207) +++ branches/stable/1_0/libsemanage/src/semanageswig_wrap.c 2007-01-26 21:04:34 UTC (rev 2208) @@ -3528,7 +3528,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_module_info_t *temp2 ; + semanage_module_info_t *temp2 = NULL ; int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -3923,7 +3923,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_context_t *temp2 ; + semanage_context_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -3956,7 +3956,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_context_t *temp3 ; + semanage_context_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4017,7 +4017,7 @@ int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - semanage_context_t *temp3 ; + semanage_context_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4058,7 +4058,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char *temp3 ; + char *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4099,7 +4099,7 @@ int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - semanage_bool_key_t *temp3 ; + semanage_bool_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4140,7 +4140,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_bool_key_t *temp3 ; + semanage_bool_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4376,7 +4376,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_bool_t *temp2 ; + semanage_bool_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -4409,7 +4409,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_bool_t *temp3 ; + semanage_bool_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4469,7 +4469,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_bool_t *temp3 ; + semanage_bool_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4616,7 +4616,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_bool_t **temp2 ; + semanage_bool_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -4734,7 +4734,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_bool_t *temp3 ; + semanage_bool_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4881,7 +4881,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_bool_t **temp2 ; + semanage_bool_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -4968,7 +4968,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_bool_t *temp3 ; + semanage_bool_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -5115,7 +5115,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_bool_t **temp2 ; + semanage_bool_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -5225,7 +5225,7 @@ int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - semanage_iface_key_t *temp3 ; + semanage_iface_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -5266,7 +5266,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_iface_key_t *temp3 ; + semanage_iface_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -5512,7 +5512,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_iface_t *temp2 ; + semanage_iface_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -5545,7 +5545,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_iface_t *temp3 ; + semanage_iface_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -5676,7 +5676,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_iface_t *temp3 ; + semanage_iface_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -5823,7 +5823,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_iface_t **temp2 ; + semanage_iface_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -5870,7 +5870,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_iface_t *temp3 ; + semanage_iface_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -6017,7 +6017,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_iface_t **temp2 ; + semanage_iface_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -6065,7 +6065,7 @@ int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - semanage_user_key_t *temp3 ; + semanage_user_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -6106,7 +6106,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_user_key_t *temp3 ; + semanage_user_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -6621,7 +6621,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char **temp3 ; + char **temp3 = NULL ; unsigned int temp4 ; int res4 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -6675,7 +6675,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char *temp3 ; + char *temp3 = NULL ; unsigned int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; @@ -6720,7 +6720,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_user_t *temp2 ; + semanage_user_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -6753,7 +6753,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_user_t *temp3 ; + semanage_user_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -6884,7 +6884,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_user_t *temp3 ; + semanage_user_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -7031,7 +7031,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_user_t **temp2 ; + semanage_user_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -7078,7 +7078,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_user_t *temp3 ; + semanage_user_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -7225,7 +7225,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_user_t **temp2 ; + semanage_user_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -7340,7 +7340,7 @@ int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; - semanage_port_key_t *temp5 ; + semanage_port_key_t *temp5 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -7391,7 +7391,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_port_key_t *temp3 ; + semanage_port_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -7697,7 +7697,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_port_t *temp2 ; + semanage_port_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -7730,7 +7730,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_port_t *temp3 ; + semanage_port_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -7861,7 +7861,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_port_t *temp3 ; + semanage_port_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -8008,7 +8008,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_port_t **temp2 ; + semanage_port_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -8055,7 +8055,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_port_t *temp3 ; + semanage_port_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -8202,7 +8202,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_port_t **temp2 ; + semanage_port_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -8315,7 +8315,7 @@ int alloc2 = 0 ; int val3 ; int ecode3 = 0 ; - semanage_fcontext_key_t *temp4 ; + semanage_fcontext_key_t *temp4 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -8362,7 +8362,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_fcontext_key_t *temp3 ; + semanage_fcontext_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -8620,7 +8620,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_fcontext_t *temp2 ; + semanage_fcontext_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -8653,7 +8653,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_fcontext_t *temp3 ; + semanage_fcontext_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -8784,7 +8784,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_fcontext_t *temp3 ; + semanage_fcontext_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -8931,7 +8931,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_fcontext_t **temp2 ; + semanage_fcontext_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -8978,7 +8978,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_fcontext_t *temp3 ; + semanage_fcontext_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -9125,7 +9125,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_fcontext_t **temp2 ; + semanage_fcontext_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -9173,7 +9173,7 @@ int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - semanage_seuser_key_t *temp3 ; + semanage_seuser_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -9214,7 +9214,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_seuser_key_t *temp3 ; + semanage_seuser_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -9528,7 +9528,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_seuser_t *temp2 ; + semanage_seuser_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -9561,7 +9561,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_seuser_t *temp3 ; + semanage_seuser_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -9692,7 +9692,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_seuser_t *temp3 ; + semanage_seuser_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -9839,7 +9839,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_seuser_t **temp2 ; + semanage_seuser_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -9886,7 +9886,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_seuser_t *temp3 ; + semanage_seuser_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -10033,7 +10033,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_seuser_t **temp2 ; + semanage_seuser_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -10150,7 +10150,7 @@ int alloc3 = 0 ; int val4 ; int ecode4 = 0 ; - semanage_node_key_t *temp5 ; + semanage_node_key_t *temp5 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -10205,7 +10205,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_node_key_t *temp3 ; + semanage_node_key_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -10265,7 +10265,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char *temp3 ; + char *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -10306,7 +10306,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char *temp3 ; + char *temp3 = NULL ; size_t temp4 ; int res4 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -10459,7 +10459,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char *temp3 ; + char *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -10500,7 +10500,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - char *temp3 ; + char *temp3 = NULL ; size_t temp4 ; int res4 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -10786,7 +10786,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_node_t *temp2 ; + semanage_node_t *temp2 = NULL ; PyObject * obj0 = 0 ; { @@ -10819,7 +10819,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_node_t *temp3 ; + semanage_node_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -10950,7 +10950,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_node_t *temp3 ; + semanage_node_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -11097,7 +11097,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_node_t **temp2 ; + semanage_node_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; @@ -11144,7 +11144,7 @@ int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - semanage_node_t *temp3 ; + semanage_node_t *temp3 = NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -11291,7 +11291,7 @@ int result; void *argp1 = 0 ; int res1 = 0 ; - semanage_node_t **temp2 ; + semanage_node_t **temp2 = NULL ; unsigned int temp3 ; int res3 = SWIG_TMPOBJ ; PyObject * obj0 = 0 ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-02-20 13:53:18
|
Revision: 2240 http://svn.sourceforge.net/selinux/?rev=2240&view=rev Author: ssmalley Date: 2007-02-20 05:53:16 -0800 (Tue, 20 Feb 2007) Log Message: ----------- ported r2232 through r2239 from trunk. Modified Paths: -------------- branches/stable/1_0/checkpolicy/policy_parse.y branches/stable/1_0/libselinux/include/selinux/avc.h branches/stable/1_0/libselinux/man/man3/avc_add_callback.3 branches/stable/1_0/libselinux/src/avc.c branches/stable/1_0/libselinux/src/avc_internal.c branches/stable/1_0/libselinux/src/avc_internal.h branches/stable/1_0/libselinux/src/avc_sidtab.c branches/stable/1_0/libselinux/src/selinux_netlink.h branches/stable/1_0/libsemanage/Makefile branches/stable/1_0/libsemanage/src/direct_api.c branches/stable/1_0/libsemanage/src/semanage_store.c branches/stable/1_0/libsemanage/src/semanage_store.h branches/stable/1_0/policycoreutils/semanage/seobject.py branches/stable/1_0/policycoreutils/setfiles/setfiles.c Modified: branches/stable/1_0/checkpolicy/policy_parse.y =================================================================== --- branches/stable/1_0/checkpolicy/policy_parse.y 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/checkpolicy/policy_parse.y 2007-02-20 13:53:16 UTC (rev 2240) @@ -929,11 +929,6 @@ yyerror("no class name for class definition?"); return -1; } - if (id_has_dot(id)) { - free(id); - yyerror("class identifiers may not contain periods"); - return -1; - } datum = (class_datum_t *) malloc(sizeof(class_datum_t)); if (!datum) { yyerror("out of memory"); Modified: branches/stable/1_0/libselinux/include/selinux/avc.h =================================================================== --- branches/stable/1_0/libselinux/include/selinux/avc.h 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/include/selinux/avc.h 2007-02-20 13:53:16 UTC (rev 2240) @@ -304,11 +304,11 @@ * -%1 if insufficient memory exists to add the callback. */ int avc_add_callback(int (*callback) - (u_int32_t event, security_id_t ssid, + (uint32_t event, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, access_vector_t * out_retained), - u_int32_t events, security_id_t ssid, + uint32_t events, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms); Modified: branches/stable/1_0/libselinux/man/man3/avc_add_callback.3 =================================================================== --- branches/stable/1_0/libselinux/man/man3/avc_add_callback.3 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/man/man3/avc_add_callback.3 2007-02-20 13:53:16 UTC (rev 2240) @@ -9,7 +9,7 @@ .br .B #include <selinux/avc.h> .sp -.BI "int avc_add_callback(int (*" callback ")(u_int32_t " event , +.BI "int avc_add_callback(int (*" callback ")(uint32_t " event , .in +\w'int avc_add_callback(int (*callback)('u .BI "security_id_t " ssid , .br @@ -22,7 +22,7 @@ .BI "access_vector_t *" out_retained ")," .in .in +\w'int avc_add_callback('u -.BI "u_int32_t " events ", security_id_t " ssid , +.BI "uint32_t " events ", security_id_t " ssid , .br .BI "security_id_t " tsid ", security_class_t " tclass , .br Modified: branches/stable/1_0/libselinux/src/avc.c =================================================================== --- branches/stable/1_0/libselinux/src/avc.c 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/src/avc.c 2007-02-20 13:53:16 UTC (rev 2240) @@ -49,9 +49,9 @@ } }; static const struct av_perm_to_string { - u16 tclass; - u16 nameidx; - u32 value; + uint16_t tclass; + uint16_t nameidx; + uint32_t value; } av_perm_to_string[] = { #define S_(c, v, s) { c, offsetof(union av_perm_to_string_data, L1(__LINE__)), v }, #include "av_perm_to_string.h" @@ -77,7 +77,7 @@ #undef S_ } }; -static const u16 class_to_string[] = { +static const uint16_t class_to_string[] = { #define S_(s) offsetof(union class_to_string_data, L1(__LINE__)), #include "class_to_string.h" #undef S_ @@ -112,7 +112,7 @@ struct { #define TB_(s) struct { #define TE_(s) } s##_part; -#define S_(s) u16 L1(__LINE__) +#define S_(s) uint16_t L1(__LINE__) #define L1(l) L2(l) #define L2(l) field_##l; #include "common_perm_to_string.h" @@ -122,7 +122,7 @@ #undef L1 #undef L2 }; - u16 data[0]; + uint16_t data[0]; } common_perm_to_string = { { #define TB_(s) { @@ -140,11 +140,11 @@ }; static const struct av_inherit { - u16 tclass; - u16 common_pts_idx; - u32 common_base; + uint16_t tclass; + uint16_t common_pts_idx; + uint32_t common_base; } av_inherit[] = { -#define S_(c, i, b) { c, offsetof(union common_perm_to_string, common_##i##_perm_to_string_part)/sizeof(u16), b }, +#define S_(c, i, b) { c, offsetof(union common_perm_to_string, common_##i##_perm_to_string_part)/sizeof(uint16_t), b }, #include "av_inherit.h" #undef S_ }; @@ -168,17 +168,17 @@ struct avc_cache { struct avc_node *slots[AVC_CACHE_SLOTS]; - u_int32_t lru_hint; /* LRU hint for reclaim scan */ - u_int32_t active_nodes; - u_int32_t latest_notif; /* latest revocation notification */ + uint32_t lru_hint; /* LRU hint for reclaim scan */ + uint32_t active_nodes; + uint32_t latest_notif; /* latest revocation notification */ }; struct avc_callback_node { - int (*callback) (u_int32_t event, security_id_t ssid, + int (*callback) (uint32_t event, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, access_vector_t * out_retained); - u_int32_t events; + uint32_t events; security_id_t ssid; security_id_t tsid; security_class_t tclass; @@ -402,7 +402,7 @@ { struct avc_node *prev, *cur; int try; - u_int32_t hvalue; + uint32_t hvalue; hvalue = avc_cache.lru_hint; for (try = 0; try < 2; try++) { @@ -795,8 +795,8 @@ */ static void avc_dump_av(security_class_t tclass, access_vector_t av) { - const u16 *common_pts_idx = 0; - u_int32_t common_base = 0, perm; + const uint16_t *common_pts_idx = 0; + uint32_t common_base = 0, perm; unsigned int i, i2; if (av == 0) { @@ -1006,12 +1006,12 @@ return rc; } -int avc_add_callback(int (*callback) (u_int32_t event, security_id_t ssid, +int avc_add_callback(int (*callback) (uint32_t event, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, access_vector_t * out_retained), - u_int32_t events, security_id_t ssid, + uint32_t events, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms) { @@ -1041,7 +1041,7 @@ return (x == y || x == SECSID_WILD || y == SECSID_WILD); } -static inline void avc_update_node(u_int32_t event, struct avc_node *node, +static inline void avc_update_node(uint32_t event, struct avc_node *node, access_vector_t perms) { switch (event) { @@ -1067,7 +1067,7 @@ } } -static int avc_update_cache(u_int32_t event, security_id_t ssid, +static int avc_update_cache(uint32_t event, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms) { @@ -1105,10 +1105,10 @@ * This should not be called directly; use the individual event * functions instead. */ -static int avc_control(u_int32_t event, security_id_t ssid, +static int avc_control(uint32_t event, security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno, access_vector_t * out_retained) + uint32_t seqno, access_vector_t * out_retained) { struct avc_callback_node *c; access_vector_t tretained = 0, cretained = 0; @@ -1167,7 +1167,7 @@ */ int avc_ss_grant(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno) + uint32_t seqno) { return avc_control(AVC_CALLBACK_GRANT, ssid, tsid, tclass, perms, seqno, 0); @@ -1188,7 +1188,7 @@ */ int avc_ss_try_revoke(security_id_t ssid, security_id_t tsid, security_class_t tclass, - access_vector_t perms, u_int32_t seqno, + access_vector_t perms, uint32_t seqno, access_vector_t * out_retained) { return avc_control(AVC_CALLBACK_TRY_REVOKE, @@ -1208,7 +1208,7 @@ */ int avc_ss_revoke(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno) + uint32_t seqno) { return avc_control(AVC_CALLBACK_REVOKE, ssid, tsid, tclass, perms, seqno, 0); @@ -1218,7 +1218,7 @@ * avc_ss_reset - Flush the cache and revalidate migrated permissions. * @seqno: policy sequence number */ -int avc_ss_reset(u_int32_t seqno) +int avc_ss_reset(uint32_t seqno) { int rc; @@ -1243,7 +1243,7 @@ */ int avc_ss_set_auditallow(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno, u_int32_t enable) + uint32_t seqno, uint32_t enable) { if (enable) return avc_control(AVC_CALLBACK_AUDITALLOW_ENABLE, @@ -1264,7 +1264,7 @@ */ int avc_ss_set_auditdeny(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno, u_int32_t enable) + uint32_t seqno, uint32_t enable) { if (enable) return avc_control(AVC_CALLBACK_AUDITDENY_ENABLE, @@ -1303,7 +1303,7 @@ access_vector_t string_to_av_perm(security_class_t tclass, const char *s) { - const u16 *common_pts_idx = 0; + const uint16_t *common_pts_idx = 0; access_vector_t perm, common_base = 0; unsigned int i; @@ -1340,7 +1340,7 @@ void print_access_vector(security_class_t tclass, access_vector_t av) { - const u16 *common_pts_idx = 0; + const uint16_t *common_pts_idx = 0; access_vector_t common_base = 0; unsigned int i, i2, perm; Modified: branches/stable/1_0/libselinux/src/avc_internal.c =================================================================== --- branches/stable/1_0/libselinux/src/avc_internal.c 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/src/avc_internal.c 2007-02-20 13:53:16 UTC (rev 2240) @@ -11,12 +11,12 @@ #include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> -#include <asm/types.h> #include <linux/netlink.h> #include "selinux_netlink.h" #include "avc_internal.h" Modified: branches/stable/1_0/libselinux/src/avc_internal.h =================================================================== --- branches/stable/1_0/libselinux/src/avc_internal.h 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/src/avc_internal.h 2007-02-20 13:53:16 UTC (rev 2240) @@ -15,10 +15,6 @@ #include <selinux/avc.h> #include "dso.h" -typedef u_int32_t u32; -typedef u_int16_t u16; -typedef u_int8_t u8; - /* SID reference counter manipulation */ static inline int sid_inc_refcnt(security_id_t sid) { @@ -164,21 +160,21 @@ /* internal callbacks */ int avc_ss_grant(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno) hidden; + uint32_t seqno) hidden; int avc_ss_try_revoke(security_id_t ssid, security_id_t tsid, security_class_t tclass, - access_vector_t perms, u_int32_t seqno, + access_vector_t perms, uint32_t seqno, access_vector_t * out_retained) hidden; int avc_ss_revoke(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno) hidden; -int avc_ss_reset(u_int32_t seqno) hidden; + uint32_t seqno) hidden; +int avc_ss_reset(uint32_t seqno) hidden; int avc_ss_set_auditallow(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno, u_int32_t enable) hidden; + uint32_t seqno, uint32_t enable) hidden; int avc_ss_set_auditdeny(security_id_t ssid, security_id_t tsid, security_class_t tclass, access_vector_t perms, - u_int32_t seqno, u_int32_t enable) hidden; + uint32_t seqno, uint32_t enable) hidden; /* netlink kernel message code */ extern int avc_netlink_trouble hidden; Modified: branches/stable/1_0/libselinux/src/avc_sidtab.c =================================================================== --- branches/stable/1_0/libselinux/src/avc_sidtab.c 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/src/avc_sidtab.c 2007-02-20 13:53:16 UTC (rev 2240) @@ -6,6 +6,7 @@ #include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include <string.h> #include "selinux_internal.h" #include <selinux/avc.h> Modified: branches/stable/1_0/libselinux/src/selinux_netlink.h =================================================================== --- branches/stable/1_0/libselinux/src/selinux_netlink.h 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libselinux/src/selinux_netlink.h 2007-02-20 13:53:16 UTC (rev 2240) @@ -25,7 +25,7 @@ }; struct selnl_msg_policyload { - u_int32_t seqno; + uint32_t seqno; }; #endif /* _LINUX_SELINUX_NETLINK_H */ Modified: branches/stable/1_0/libsemanage/Makefile =================================================================== --- branches/stable/1_0/libsemanage/Makefile 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libsemanage/Makefile 2007-02-20 13:53:16 UTC (rev 2240) @@ -23,4 +23,5 @@ $(MAKE) -C src $@ $(MAKE) -C include $@ -test: +test: all + $(MAKE) -C tests test Modified: branches/stable/1_0/libsemanage/src/direct_api.c =================================================================== --- branches/stable/1_0/libsemanage/src/direct_api.c 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libsemanage/src/direct_api.c 2007-02-20 13:53:16 UTC (rev 2240) @@ -65,7 +65,7 @@ int *num_modules); static struct semanage_policy_table direct_funcs = { - .get_serial = semanage_get_commit_number, + .get_serial = semanage_direct_get_serial, .destroy = semanage_direct_destroy, .disconnect = semanage_direct_disconnect, .begin_trans = semanage_direct_begintrans, @@ -911,7 +911,7 @@ goto cleanup; } if (num_mod_files == 0) { - retval = semanage_get_commit_number(sh); + retval = semanage_direct_get_serial(sh); goto cleanup; } @@ -954,7 +954,7 @@ free(version); } } - retval = semanage_get_commit_number(sh); + retval = semanage_direct_get_serial(sh); cleanup: sepol_policy_file_free(pf); Modified: branches/stable/1_0/libsemanage/src/semanage_store.c =================================================================== --- branches/stable/1_0/libsemanage/src/semanage_store.c 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libsemanage/src/semanage_store.c 2007-02-20 13:53:16 UTC (rev 2240) @@ -968,14 +968,14 @@ if (!strncmp(buf, "HOME_DIR", 8) || !strncmp(buf, "HOME_ROOT", 9) || strstr(buf, "ROLE")) { /* This contains one of the template variables, write it to homedir.template */ - if (write(hd, buf, strnlen(buf, PATH_MAX)) == 0) { + if (write(hd, buf, strlen(buf)) == 0) { ERR(sh, "Write to %s failed.", semanage_path(SEMANAGE_TMP, SEMANAGE_HOMEDIR_TMPL)); goto cleanup; } } else { - if (write(fc, buf, strnlen(buf, PATH_MAX)) == 0) { + if (write(fc, buf, strlen(buf)) == 0) { ERR(sh, "Write to %s failed.", semanage_path(SEMANAGE_TMP, SEMANAGE_FC)); goto cleanup; @@ -1151,7 +1151,7 @@ struct stat buf; /* update the commit number */ - if ((commit_number = semanage_get_commit_number(sh)) < 0) { + if ((commit_number = semanage_direct_get_serial(sh)) < 0) { return -1; } commit_number++; @@ -1412,7 +1412,7 @@ /* Read the current commit number from the commit number file which * the handle is pointing, resetting the file pointer afterwards. * Return it (a non-negative number), or -1 on error. */ -int semanage_get_commit_number(semanage_handle_t * sh) +int semanage_direct_get_serial(semanage_handle_t * sh) { char buf[32]; int fd, commit_number; Modified: branches/stable/1_0/libsemanage/src/semanage_store.h =================================================================== --- branches/stable/1_0/libsemanage/src/semanage_store.h 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/libsemanage/src/semanage_store.h 2007-02-20 13:53:16 UTC (rev 2240) @@ -89,7 +89,7 @@ int semanage_get_active_lock(semanage_handle_t * sh); void semanage_release_trans_lock(semanage_handle_t * sh); void semanage_release_active_lock(semanage_handle_t * sh); -int semanage_get_commit_number(semanage_handle_t * sh); +int semanage_direct_get_serial(semanage_handle_t * sh); int semanage_link_sandbox(semanage_handle_t * sh, sepol_module_package_t ** base); Modified: branches/stable/1_0/policycoreutils/semanage/seobject.py =================================================================== --- branches/stable/1_0/policycoreutils/semanage/seobject.py 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/policycoreutils/semanage/seobject.py 2007-02-20 13:53:16 UTC (rev 2240) @@ -139,7 +139,7 @@ translations = fd.readlines() fd.close() except IOError, e: - raise ValueError(_("Unable to open %s: translations not supported on non-MLS machines") % (self.filename, e) ) + raise ValueError(_("Unable to open %s: translations not supported on non-MLS machines") % (self.filename) ) self.ddict = {} self.comments = [] Modified: branches/stable/1_0/policycoreutils/setfiles/setfiles.c =================================================================== --- branches/stable/1_0/policycoreutils/setfiles/setfiles.c 2007-02-20 13:43:22 UTC (rev 2239) +++ branches/stable/1_0/policycoreutils/setfiles/setfiles.c 2007-02-20 13:53:16 UTC (rev 2240) @@ -357,6 +357,7 @@ "%s: %s not reset customized by admin to %s\n", progname, my_file, context); } + freecon(context); goto out; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-02-20 14:07:08
|
Revision: 2242 http://svn.sourceforge.net/selinux/?rev=2242&view=rev Author: ssmalley Date: 2007-02-20 06:06:53 -0800 (Tue, 20 Feb 2007) Log Message: ----------- Update ChangeLogs and VERSIONs. Modified Paths: -------------- branches/stable/1_0/checkpolicy/ChangeLog branches/stable/1_0/checkpolicy/VERSION branches/stable/1_0/libselinux/ChangeLog branches/stable/1_0/libselinux/VERSION branches/stable/1_0/libsemanage/ChangeLog branches/stable/1_0/libsemanage/VERSION branches/stable/1_0/policycoreutils/ChangeLog branches/stable/1_0/policycoreutils/VERSION Modified: branches/stable/1_0/checkpolicy/ChangeLog =================================================================== --- branches/stable/1_0/checkpolicy/ChangeLog 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/checkpolicy/ChangeLog 2007-02-20 14:06:53 UTC (rev 2242) @@ -1,3 +1,6 @@ +1.34.1 2007-02-20 + * Merged patch to allow dots in class identifiers from Caleb Case. + 1.34.0 2007-01-18 * Updated version for stable branch. Modified: branches/stable/1_0/checkpolicy/VERSION =================================================================== --- branches/stable/1_0/checkpolicy/VERSION 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/checkpolicy/VERSION 2007-02-20 14:06:53 UTC (rev 2242) @@ -1 +1 @@ -1.34.0 +1.34.1 Modified: branches/stable/1_0/libselinux/ChangeLog =================================================================== --- branches/stable/1_0/libselinux/ChangeLog 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/libselinux/ChangeLog 2007-02-20 14:06:53 UTC (rev 2242) @@ -1,3 +1,6 @@ +1.34.3 2007-02-20 + * Merged patch from Todd Miller to convert int types over to C99 style. + 1.34.2 2007-02-01 * Merged patch from Todd Miller to remove sscanf in matchpathcon.c because of the use of the non-standard format %as. (original patch changed Modified: branches/stable/1_0/libselinux/VERSION =================================================================== --- branches/stable/1_0/libselinux/VERSION 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/libselinux/VERSION 2007-02-20 14:06:53 UTC (rev 2242) @@ -1 +1 @@ -1.34.2 +1.34.3 Modified: branches/stable/1_0/libsemanage/ChangeLog =================================================================== --- branches/stable/1_0/libsemanage/ChangeLog 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/libsemanage/ChangeLog 2007-02-20 14:06:53 UTC (rev 2242) @@ -1,3 +1,8 @@ +1.10.2 2007-02-20 + * Merged Makefile test target patch from Caleb Case. + * Merged get_commit_number function rename patch from Caleb Case. + * Merged strnlen -> strlen patch from Todd Miller. + 1.10.1 2007-01-26 * Merged python binding fix from Dan Walsh. Modified: branches/stable/1_0/libsemanage/VERSION =================================================================== --- branches/stable/1_0/libsemanage/VERSION 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/libsemanage/VERSION 2007-02-20 14:06:53 UTC (rev 2242) @@ -1 +1 @@ -1.10.1 +1.10.2 Modified: branches/stable/1_0/policycoreutils/ChangeLog =================================================================== --- branches/stable/1_0/policycoreutils/ChangeLog 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/policycoreutils/ChangeLog 2007-02-20 14:06:53 UTC (rev 2242) @@ -1,3 +1,7 @@ +1.34.2 2007-02-20 + * Merged seobject exception handler fix from Caleb Case. + * Merged setfiles memory leak patch from Todd Miller. + 1.34.1 2007-01-22 * Fixed newrole non-pam build. Modified: branches/stable/1_0/policycoreutils/VERSION =================================================================== --- branches/stable/1_0/policycoreutils/VERSION 2007-02-20 14:03:10 UTC (rev 2241) +++ branches/stable/1_0/policycoreutils/VERSION 2007-02-20 14:06:53 UTC (rev 2242) @@ -1 +1 @@ -1.34.1 +1.34.2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-02-21 17:38:17
|
Revision: 2250 http://svn.sourceforge.net/selinux/?rev=2250&view=rev Author: ssmalley Date: 2007-02-21 09:38:15 -0800 (Wed, 21 Feb 2007) Log Message: ----------- Ported r2243 through r2244 from trunk. Modified Paths: -------------- branches/stable/1_0/libselinux/src/selinux.py branches/stable/1_0/libselinux/src/selinuxswig.i branches/stable/1_0/libselinux/src/selinuxswig_wrap.c branches/stable/1_0/policycoreutils/po/mr.po branches/stable/1_0/policycoreutils/po/ms.po branches/stable/1_0/policycoreutils/po/sv.po branches/stable/1_0/policycoreutils/po/uk.po branches/stable/1_0/policycoreutils/scripts/chcat branches/stable/1_0/policycoreutils/scripts/chcat.8 branches/stable/1_0/policycoreutils/scripts/fixfiles.8 branches/stable/1_0/policycoreutils/semanage/seobject.py Modified: branches/stable/1_0/libselinux/src/selinux.py =================================================================== --- branches/stable/1_0/libselinux/src/selinux.py 2007-02-21 17:19:31 UTC (rev 2249) +++ branches/stable/1_0/libselinux/src/selinux.py 2007-02-21 17:38:15 UTC (rev 2250) @@ -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: branches/stable/1_0/libselinux/src/selinuxswig.i =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig.i 2007-02-21 17:19:31 UTC (rev 2249) +++ branches/stable/1_0/libselinux/src/selinuxswig.i 2007-02-21 17:38:15 UTC (rev 2250) @@ -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: branches/stable/1_0/libselinux/src/selinuxswig_wrap.c =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-02-21 17:19:31 UTC (rev 2249) +++ branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-02-21 17:38:15 UTC (rev 2250) @@ -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) { Modified: branches/stable/1_0/policycoreutils/po/mr.po =================================================================== --- branches/stable/1_0/policycoreutils/po/mr.po 2007-02-21 17:19:31 UTC (rev 2249) +++ branches/stable/1_0/policycoreutils/po/mr.po 2007-02-21 17:38:15 UTC (rev 2250) @@ -2,14 +2,15 @@ # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # Rahul Bhalerao <rbh...@re...>, 2006. +# Rahul Bhalerao <b.r...@gm...>, 2006. # msgid "" msgstr "" "Project-Id-Version: mr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-11-21 14:21-0500\n" -"PO-Revision-Date: 2006-06-13 14:36+0530\n" -"Last-Translator: Rahul Bhalerao <rbh...@re...>\n" +"PO-Revision-Date: 2006-12-14 05:09+0530\n" +"Last-Translator: Rahul Bhalerao <b.r...@gm...>\n" "Language-Team: Marathi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,286 +21,285 @@ #: ../load_policy/load_policy.c:22 #, c-format msgid "usage: %s [-bq]\n" -msgstr "" +msgstr "वापर: %s [-bq]\n" #: ../load_policy/load_policy.c:66 #, c-format msgid "%s: Can't load policy: %s\n" -msgstr "" +msgstr "%s: धोरण भारित करू शकत नाही: %s\n" #: ../newrole/newrole.c:188 #, c-format msgid "failed to set PAM_TTY\n" -msgstr "" +msgstr "PAM_TTY निर्धारित करण्यात असफल\n" #: ../newrole/newrole.c:218 ../run_init/run_init.c:162 -#, fuzzy msgid "Password:" msgstr "गुप्तशब्द:" #: ../newrole/newrole.c:243 ../run_init/run_init.c:197 #, c-format msgid "Cannot find your entry in the shadow passwd file.\n" -msgstr "" +msgstr "तुमची नोंद छाया passwd फाइलमध्ये सापडू शकली नाही.\n" #: ../newrole/newrole.c:250 ../run_init/run_init.c:203 #, c-format msgid "getpass cannot open /dev/tty\n" -msgstr "" +msgstr "getpass /dev/tty उघडू शकत नाही\n" #: ../newrole/newrole.c:316 #, c-format msgid "cannot find valid entry in the passwd file.\n" -msgstr "" +msgstr "passwd फाइलमध्ये वैध प्रविष्ट सापडू शकले नाही.\n" #: ../newrole/newrole.c:327 #, c-format msgid "Out of memory!\n" -msgstr "" +msgstr "स्मृतीबाहेर!\n" #: ../newrole/newrole.c:332 -#, fuzzy, c-format +#, c-format msgid "Error! Shell is not valid.\n" -msgstr "चूक" +msgstr "चूक! शेल वैध नाही.\n" #: ../newrole/newrole.c:389 #, c-format msgid "Unable to clear environment\n" -msgstr "" +msgstr "पर्यावरण साफ करण्यास असमर्थ\n" #: ../newrole/newrole.c:436 ../newrole/newrole.c:513 -#, fuzzy, c-format +#, c-format msgid "Error initing capabilities, aborting.\n" -msgstr "चूक" +msgstr "क्षमता आरंभण्यात चूक, सोडत आहे.\n" #: ../newrole/newrole.c:444 ../newrole/newrole.c:519 -#, fuzzy, c-format +#, c-format msgid "Error setting capabilities, aborting\n" -msgstr "चूक" +msgstr "क्षमता निर्धारित करण्यात चूक, सोडत आहे\n" #: ../newrole/newrole.c:450 -#, fuzzy, c-format +#, c-format msgid "Error setting KEEPCAPS, aborting\n" -msgstr "चूक" +msgstr "KEEPCAPS निर्धारित क\xE0\xA4\xB0ण्यात चूक, सोडत आहे\n" #: ../newrole/newrole.c:458 ../newrole/newrole.c:531 -#, fuzzy, c-format +#, c-format msgid "Error dropping capabilities, aborting\n" -msgstr "चूक" +msgstr "क्षमता सोडण्यात चूक, सोडत आहे\n" #: ../newrole/newrole.c:464 ../newrole/newrole.c:562 -#, fuzzy, c-format +#, c-format msgid "Error changing uid, aborting.\n" -msgstr "चूक" +msgstr "uid बदलण्यात चूक, सोडत आहे.\n" #: ../newrole/newrole.c:470 ../newrole/newrole.c:525 ../newrole/newrole.c:557 -#, fuzzy, c-format +#, c-format msgid "Error resetting KEEPCAPS, aborting\n" -msgstr "चूक" +msgstr "KEEPCAPS पुनःनिर्धारित करण्यात चूक, सोडत आहे\n" #: ../newrole/newrole.c:477 -#, fuzzy, c-format +#, c-format msgid "Error dropping SETUID capability, aborting\n" -msgstr "चूक" +msgstr "SETUID क्षमता सोडण्यात चूक, सोडत आहे\n" #: ../newrole/newrole.c:482 ../newrole/newrole.c:536 #, c-format msgid "Error freeing caps\n" -msgstr "" +msgstr "caps मुक्त करण्यात चूक\n" #: ../newrole/newrole.c:580 -#, fuzzy, c-format +#, c-format msgid "Error connecting to audit system.\n" -msgstr "चूक" +msgstr "ऑडिट प्रणालीस जोडण्यात चूक\n" #: ../newrole/newrole.c:586 -#, fuzzy, c-format +#, c-format msgid "Error allocating memory.\n" -msgstr "चूक" +msgstr "स्मृती वाटपात चूक.\n" #: ../newrole/newrole.c:593 -#, fuzzy, c-format +#, c-format msgid "Error sending audit message.\n" -msgstr "चूक" +msgstr "ऑडिट संदेश पाठवण्यात चूक.\n" #: ../newrole/newrole.c:634 ../newrole/newrole.c:978 #, c-format msgid "Could not determine enforcing mode.\n" -msgstr "" +msgstr "बलप्रविष्ट रीत ठरवता आली नाह\xE0\xA5\x80.\n" #: ../newrole/newrole.c:641 -#, fuzzy, c-format +#, c-format msgid "Error! Could not open %s.\n" -msgstr "चूक" +msgstr "चूक! %s उघडू शकलो नाही.\n" #: ../newrole/newrole.c:646 #, c-format msgid "%s! Could not get current context for %s, not relabeling tty.\n" -msgstr "" +msgstr "%s! %s साठी चालू संदर्भ मिळवता आला नाही, tty ला पुनःलेबलिंग करत नाही.\n" #: ../newrole/newrole.c:656 #, c-format msgid "%s! Could not get new context for %s, not relabeling tty.\n" -msgstr "" +msgstr "%s! %s साठी नविन संदर्भ मिळवता आला नाही, tty ला पुनःलेबलिंग करत नाही.\n" #: ../newrole/newrole.c:666 #, c-format msgid "%s! Could not set new context for %s\n" -msgstr "" +msgstr "%s! %s साठी नविन संदर्भ निर्धारित करता आला नाही\n" #: ../newrole/newrole.c:710 #, c-format msgid "%s changed labels.\n" -msgstr "" +msgstr "%s बदललेली लेबले.\n" #: ../newrole/newrole.c:716 -#, fuzzy, c-format +#, c-format msgid "Warning! Could not restore context for %s\n" -msgstr "ताकीद" +msgstr "सुचना! %s साठी संदर्भ पुनःरक्षित करता आला नाही\n" #: ../newrole/newrole.c:772 -#, fuzzy, c-format +#, c-format msgid "Error: multiple roles specified\n" -msgstr "चूक" +msgstr "चूक: बहू भूमिका दर्शवल्या\n" #: ../newrole/newrole.c:780 -#, fuzzy, c-format +#, c-format msgid "Error: multiple types specified\n" -msgstr "चूक" +msgstr "चूक: बहू प्रकार दर्शवले\n" #: ../newrole/newrole.c:787 #, c-format msgid "Sorry, -l may be used with SELinux MLS support.\n" -msgstr "" +msgstr "क्षमा, -l SELinux MLS आधारासह वापर\xE0\xA4\xA4ा येऊ शकतो.\n" #: ../newrole/newrole.c:792 -#, fuzzy, c-format +#, c-format msgid "Error: multiple levels specified\n" -msgstr "चूक" +msgstr "चूक: बहू स्तर दर्शवले\n" #: ../newrole/newrole.c:814 #, c-format msgid "Couldn't get default type.\n" -msgstr "" +msgstr "मुलभूत प्रकार मिळवता आला नाही.\n" #: ../newrole/newrole.c:824 #, c-format msgid "failed to get new context.\n" -msgstr "" +msgstr "नविन संदर्भ मिळवण्यास अपयशी.\n" #: ../newrole/newrole.c:831 #, c-format msgid "failed to set new role %s\n" -msgstr "" +msgstr "निवन भुमिका %s निर्धारित करण्यात अपयशी\n" #: ../newrole/newrole.c:838 #, c-format msgid "failed to set new type %s\n" -msgstr "" +msgstr "निवन प्रकार %s निर्धारित करण्यात अपयशी\n" #: ../newrole/newrole.c:847 #, c-format msgid "failed to build new range with level %s\n" -msgstr "" +msgstr "निवन परिसीमा %s स्तरासह बनवण्यात अपयशी\n" #: ../newrole/newrole.c:852 #, c-format msgid "failed to set new range %s\n" -msgstr "" +msgstr "नविन परिसीमा %s निर्धारित करण्यात अपयशी\n" #: ../newrole/newrole.c:860 #, c-format msgid "failed to convert new context to string\n" -msgstr "" +msgstr "नविन संदर्भास स्ट्रींगमध्ये रुपांतरित करण्यात अपयशी\n" #: ../newrole/newrole.c:865 #, c-format msgid "%s is not a valid context\n" -msgstr "" +msgstr "%s वैध संदर्भ नाही\n" #: ../newrole/newrole.c:872 #, c-format msgid "Unable to allocate memory for new_context" -msgstr "" +msgstr "new_context साठी स्मृती वाटप करण्यास अस\xE0\xA4\xAEर्थ" #: ../newrole/newrole.c:898 #, c-format msgid "Unable to obtain empty signal set\n" -msgstr "" +msgstr "रिकामा इशारा संच मिळवण्यास असमर्थ\n" #: ../newrole/newrole.c:906 #, c-format msgid "Unable to set SIGHUP handler\n" -msgstr "" +msgstr "SIGHUP हाताळक निर्धारित करण्यास असमर्थ\n" #: ../newrole/newrole.c:972 #, c-format msgid "Sorry, newrole may be used only on a SELinux kernel.\n" -msgstr "" +msgstr "क्षमा, newrole फक्त SELinux कर्नलवरच वापरता येऊ शकतो.\n" #: ../newrole/newrole.c:989 #, c-format msgid "failed to get old_context.\n" -msgstr "" +msgstr "old_context मिळवण्यात अपयशी.\n" #: ../newrole/newrole.c:996 -#, fuzzy, c-format +#, c-format msgid "Error! Could not retrieve tty information.\n" -msgstr "चूक" +msgstr "चूक! tty माहिती मिळवत\xE0\xA4\xBE आली नाही.\n" #: ../newrole/newrole.c:1015 #, c-format msgid "Authenticating %s.\n" -msgstr "" +msgstr "%s ला अधिप्रमाणित करत आहे.\n" #: ../newrole/newrole.c:1020 ../run_init/run_init.c:126 #, c-format msgid "failed to initialize PAM\n" -msgstr "" +msgstr "PAM आरंभण्यात अपयशी\n" #: ../newrole/newrole.c:1029 #, c-format msgid "newrole: incorrect password for %s\n" -msgstr "" +msgstr "newrole: %s साठी अयोग्य गुप्तशब्द\n" #: ../newrole/newrole.c:1056 #, c-format msgid "newrole: failure forking: %s" -msgstr "" +msgstr "newrole: अपयश फोर्कींग: %s" #: ../newrole/newrole.c:1059 ../newrole/newrole.c:1082 #, c-format msgid "Unable to restore tty label...\n" -msgstr "" +msgstr "tty लेबल पुनःरक्षित करण्यास असमर्थ...\n" #: ../newrole/newrole.c:1061 ../newrole/newrole.c:1088 #, c-format msgid "Failed to close tty properly\n" -msgstr "" +msgstr "tty व्यवस्थित बंद करण्यात अपयश\n" #: ../newrole/newrole.c:1117 #, c-format msgid "Could not close descriptors.\n" -msgstr "" +msgstr "वर्णक बंद करता आले नाहीत.\n" #: ../newrole/newrole.c:1140 -#, fuzzy, c-format +#, c-format msgid "Error allocating shell's argv0.\n" -msgstr "चूक" +msgstr "शेलचा argv0 वाटण्यात चूक.\n" #: ../newrole/newrole.c:1147 ../run_init/run_init.c:405 -#, fuzzy, c-format +#, c-format msgid "Could not set exec context to %s.\n" msgstr "exec संदर्भ %s वर निर्धारित करता आला नाही.\n" #: ../newrole/newrole.c:1173 #, c-format msgid "Unable to restore the environment, aborting\n" -msgstr "" +msgstr "पर्यावरण पुनःरक्षित करण्यास असमर्थ, सोडत आहे\n" #: ../newrole/newrole.c:1184 msgid "failed to exec shell\n" -msgstr "" +msgstr "शेल exec करण्यात अपयश\n" #: ../run_init/run_init.c:67 msgid "" @@ -307,192 +307,195 @@ " where: <script> is the name of the init script to run,\n" " <args ...> are the arguments to that script." msgstr "" +"वापर: run_init <script> <args ...>\n" +" जेथे: <script> हे चालवायच्या init स्क्रीप्टचे नाव आहे,\n" +" <args ...> हे त्या स्क्रीप्टचे आर्ग्यूमेंट्स आहेत." #: ../run_init/run_init.c:139 #, c-format msgid "failed to get account information\n" -msgstr "" +msgstr "खाते माहिती मिळवण्यात अपयशी\n" #: ../run_init/run_init.c:275 #, c-format msgid "run_init: incorrect password for %s\n" -msgstr "" +msgstr "run_init: %s साठी अयोग्य गुप्तशब्द\n" #: ../run_init/run_init.c:309 #, c-format msgid "Could not open file %s\n" -msgstr "" +msgstr "फाइल %s उघडता आली नाही\n" #: ../run_init/run_init.c:336 -#, fuzzy, c-format +#, c-format msgid "No context in file %s\n" -msgstr "नाही" +msgstr "%s फाइलमध्ये संदर्भ नाही\n" #: ../run_init/run_init.c:361 #, c-format msgid "Sorry, run_init may be used only on a SELinux kernel.\n" -msgstr "" +msgstr "क्षमा, run_init फक्त SELinux कर्नलवर वापरले जाऊ शकते.\n" #: ../run_init/run_init.c:380 #, c-format msgid "authentication failed.\n" -msgstr "" +msgstr "अधिप्रमाणन अपयशी.\n" #: ../scripts/chcat:75 ../scripts/chcat:145 msgid "Requires at least one category" -msgstr "" +msgstr "निदान एक प्रवर्ग आवश्यक" #: ../scripts/chcat:89 ../scripts/chcat:159 #, c-format msgid "Can not modify sensitivity levels using '+' on %s" -msgstr "" +msgstr "'+' वापरून %s वरील संवेदनशीलता बदलता येत नाही" #: ../scripts/chcat:93 #, c-format msgid "%s is already in %s" -msgstr "" +msgstr "%s आधीच %s मध्ये आहे" #: ../scripts/chcat:164 ../scripts/chcat:174 #, c-format msgid "%s is not in %s" -msgstr "" +msgstr "%s %s मध्ये नाही" #: ../scripts/chcat:237 ../scripts/chcat:242 msgid "Can not combine +/- with other types of categories" -msgstr "" +msgstr "+/- यांना इतर प्रकारच्या प्रवर्गांशी जोडू शकत नाही" #: ../scripts/chcat:287 msgid "Can not have multiple sensitivities" -msgstr "" +msgstr "बहू संवेदनशीलता असू शकत नाहीत" #: ../scripts/chcat:293 #, c-format msgid "Usage %s CATEGORY File ..." -msgstr "" +msgstr "वापर %s CATEGORY File ..." #: ../scripts/chcat:294 #, c-format msgid "Usage %s -l CATEGORY user ..." -msgstr "" +msgstr "वापर %s -l CATEGORY user ..." #: ../scripts/chcat:295 #, c-format msgid "Usage %s [[+|-]CATEGORY],...]q File ..." -msgstr "" +msgstr "वापर %s [[+|-]CATEGORY],...]q File ..." #: ../scripts/chcat:296 #, c-format msgid "Usage %s -l [[+|-]CATEGORY],...]q user ..." -msgstr "" +msgstr "वापर %s -l [[+|-]CATEGORY],...]q user ..." #: ../scripts/chcat:297 #, c-format msgid "Usage %s -d File ..." -msgstr "" +msgstr "वापर %s -d File ..." #: ../scripts/chcat:298 #, c-format msgid "Usage %s -l -d user ..." -msgstr "" +msgstr "वापर %s -l -d user ..." #: ../scripts/chcat:299 #, c-format msgid "Usage %s -L" -msgstr "" +msgstr "वापर %s -L" #: ../scripts/chcat:300 #, c-format msgid "Usage %s -L -l user" -msgstr "" +msgstr "वापर %s -L -l user" #: ../scripts/chcat:301 msgid "Use -- to end option list. For example" -msgstr "" +msgstr "पर्याय यादी संपवण्यासाठी -- वापरा. उदाहरणार्थ" #: ../scripts/chcat:302 msgid "chcat -- -CompanyConfidential /docs/businessplan.odt" -msgstr "" +msgstr "chcat -- -CompanyConfidential /docs/businessplan.odt" #: ../scripts/chcat:303 msgid "chcat -l +CompanyConfidential juser" -msgstr "" +msgstr "chcat -l +CompanyConfidential juser" #: ../semanage/semanage:127 msgid "Requires 2 or more arguments" -msgstr "" +msgstr "२ किंवा अधिक आग्यूमेंट्सची गरज" #: ../semanage/semanage:132 #, c-format msgid "%s not defined" -msgstr "" +msgstr "%s व्याख्यीत नाही" #: ../semanage/semanage:156 #, c-format msgid "%s not valid for %s objects\n" -msgstr "" +msgstr "%s वैध नाही %s ऑब्जेक्ट्ससाठी\n" #: ../semanage/semanage:183 ../semanage/semanage:191 msgid "range not supported on Non MLS machines" -msgstr "" +msgstr "परिसीमा Non MLS मशीनींवर समर्थित \xE0\xA4\xA8ाही" #: ../semanage/semanage:249 msgid "You must specify a role" -msgstr "" +msgstr "तुम्ही एक भुमिका दर्शवलीच पाहिजे" #: ../semanage/semanage:251 msgid "You must specify a prefix" -msgstr "" +msgstr "तुम्ही एक पूर्वपद दर्शवलेच पाहिजे" #: ../semanage/semanage:300 -#, fuzzy, c-format +#, c-format msgid "Options Error %s " -msgstr "चूक " +msgstr "पर्याय चूक %s " #: ../semanage/semanage:304 #, c-format msgid "Invalid value %s" -msgstr "" +msgstr "अवैध मूल्य %s" #: ../semanage/seobject.py:132 msgid "translations not supported on non-MLS machines" -msgstr "" +msgstr "अनुवाद non-MLS मशीनींवर समर्थित नाहीत" #: ../semanage/seobject.py:139 #, python-format msgid "Unable to open %s: translations not supported on non-MLS machines" -msgstr "" +msgstr "%s उघडण्यास अ\xE0\xA4\xB8मर्थ: अनुवाद non-MLS मशीनींवर समर्थित नाहीत" #: ../semanage/seobject.py:179 ../semanage/seobject.py:193 #, python-format msgid "Translations can not contain spaces '%s' " -msgstr "" +msgstr "अनुवादांत मोकळ्या जागा '%s' असू शकत नाहीत " #: ../semanage/seobject.py:182 #, python-format msgid "Invalid Level '%s' " -msgstr "" +msgstr "अवैध स्तर '%s' " #: ../semanage/seobject.py:185 #, python-format msgid "%s already defined in translations" -msgstr "" +msgstr "%s अनुवादांत आधिच व्याख्यीत" #: ../semanage/seobject.py:197 #, python-format msgid "%s not defined in translations" -msgstr "" +msgstr "%s अनुवादांत व्याख्यीत नाही" #: ../semanage/seobject.py:218 msgid "SELinux policy is not managed or store cannot be accessed." -msgstr "" +msgstr "SELinux धोरण व्य\xE0\xA4\xB5स्थापित नाही किंवा भंडार मिळू शकत नाही." #: ../semanage/seobject.py:223 msgid "Cannot read policy store." -msgstr "" +msgstr "धोरण भंडार वाचू शकत नाही." #: ../semanage/seobject.py:228 msgid "Could not establish semanage connection" -msgstr "" +msgstr "semanage जोडणी प्रस्तापित करू शकत नाही" #: ../semanage/seobject.py:247 ../semanage/seobject.py:305 #: ../semanage/seobject.py:352 ../semanage/seobject.py:433 @@ -501,43 +504,43 @@ #: ../semanage/seobject.py:1207 ../semanage/seobject.py:1241 #, python-format msgid "Could not create a key for %s" -msgstr "" +msgstr "%s साठी कळ निर्माण करू शकत नाही" #: ../semanage/seobject.py:251 ../semanage/seobject.py:309 #: ../semanage/seobject.py:356 ../semanage/seobject.py:362 #, python-format msgid "Could not check if login mapping for %s is defined" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग व्याख्यीत केली आहे का हे तपासू शकलो नाही" #: ../semanage/seobject.py:253 #, python-format msgid "Login mapping for %s is already defined" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग आधिच व्याख्यीत केलेली आहे" #: ../semanage/seobject.py:257 #, python-format msgid "Linux User %s does not exist" -msgstr "" +msgstr "Linux उपयोक्ता %s अस्तित्वात नाही" #: ../semanage/seobject.py:261 #, python-format msgid "Could not create login mapping for %s" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग निर्माण करू शकलो नाही" #: ../semanage/seobject.py:265 ../semanage/seobject.py:447 #, python-format msgid "Could not set name for %s" -msgstr "" +msgstr "%s साठी नाव ठेवता आले नाही" #: ../semanage/seobject.py:270 ../semanage/seobject.py:457 #, python-format msgid "Could not set MLS range for %s" -msgstr "" +msgstr "MLS परिसीमा %s साठी निर्धारित करता आली नाही" #: ../semanage/seobject.py:274 #, python-format msgid "Could not set SELinux user for %s" -msgstr "" +msgstr "SELinux उपयोक्ता %s साठी निर्धारित करता आला नाही" #: ../semanage/seobject.py:278 ../semanage/seobject.py:330 #: ../semanage/seobject.py:368 ../semanage/seobject.py:473 @@ -549,473 +552,472 @@ #: ../semanage/seobject.py:1148 ../semanage/seobject.py:1225 #: ../semanage/seobject.py:1257 msgid "Could not start semanage transaction" -msgstr "" +msgstr "semanage व्यवहार सुरू करता आला नाही" #: ../semanage/seobject.py:282 ../semanage/seobject.py:286 #, python-format msgid "Could not add login mapping for %s" -msgstr "" +msgstr "%s \xE0\xA4\xB8ाठी लॉगीन मॅपिंग जमा करता आले नाही" #: ../semanage/seobject.py:301 msgid "Requires seuser or serange" -msgstr "" +msgstr "seuser किंवा serange आवश्यक" #: ../semanage/seobject.py:311 ../semanage/seobject.py:358 #, python-format msgid "Login mapping for %s is not defined" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग व्याख्यीत नाही" #: ../semanage/seobject.py:315 #, python-format msgid "Could not query seuser for %s" -msgstr "" +msgstr "seuser ला %s साठी प्रश्न करू शकलो नाही" #: ../semanage/seobject.py:334 ../semanage/seobject.py:338 #, python-format msgid "Could not modify login mapping for %s" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग बदलू शकलो नाही" #: ../semanage/seobject.py:364 #, python-format msgid "Login mapping for %s is defined in policy, cannot be deleted" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग धोरणात व्याख्यीत आहे, ती नष्ट करता येत नाही " #: ../semanage/seobject.py:373 ../semanage/seobject.py:377 #, python-format msgid "Could not delete login mapping for %s" -msgstr "" +msgstr "%s साठी लॉगीन मॅपिंग नष्ट करू शकलो नाही" #: ../semanage/seobject.py:391 msgid "Could not list login mappings" -msgstr "" +msgstr "लॉगीन मॅपिंग्सची यादी करू शकलो नाही" #: ../semanage/seobject.py:437 ../semanage/seobject.py:508 #: ../semanage/seobject.py:566 ../semanage/seobject.py:572 #, python-format msgid "Could not check if SELinux user %s is defined" -msgstr "" +msgstr "SELinux उपयोक्ता %s व्याखीत असल्याचे तपासू शकलो नाही" #: ../semanage/seobject.py:439 #, python-format msgid "SELinux user %s is already defined" -msgstr "" +msgstr "SELinux उपयोक्ता %s आधिच व्याख्यीत आहे" #: ../semanage/seobject.py:443 #, python-format msgid "Could not create SELinux user for %s" -msgstr "" +msgstr "SELinux उपयोक्ता %s साठी निर्माण करता आला नाही" #: ../semanage/seobject.py:452 #, python-format msgid "Could not add role %s for %s" -msgstr "" +msgstr "भुमिका %s जमा करता आली नाही %s करता" #: ../semanage/seobject.py:461 #, python-format msgid "Could not set MLS level for %s" -msgstr "" +msgstr "%s साठी MLS स्तर निर्धारित करता आला नाही" #: ../semanage/seobject.py:463 ../semanage/seobject.py:530 #, python-format msgid "Invalid prefix %s" -msgstr "" +msgstr "अवैध पूर्वपद %s" #: ../semanage/seobject.py:466 #, python-format msgid "Could not add prefix %s for %s" -msgstr "" +msgstr "पूर्वपद %s जमा करता आले नाही %s करीता" #: ../semanage/seobject.py:469 #, python-format msgid "Could not extract key for %s" -msgstr "" +msgstr "%s साठी कळ खेचता आली नाही" #: ../semanage/seobject.py:477 ../semanage/seobject.py:481 #, python-format msgid "Could not add SELinux user %s" -msgstr "" +msgstr "SELinux उपयोक्ता %s जोडता आला नाही" #: ../semanage/seobject.py:498 msgid "Requires prefix, roles, level or range" -msgstr "" +msgstr "पूर्वपद, भुमिका, स्तर किंवा परिसीमा आवश्यक" #: ../semanage/seobject.py:500 msgid "Requires prefix or roles" -msgstr "" +msgstr "पूर्वपद किंवा भुमिका आवश्यक" #: ../semanage/seobject.py:510 ../semanage/seobject.py:568 #, python-format msgid "SELinux user %s is not defined" -msgstr "" +msgstr "SELinux उपयोक्ता %s व्याख्यीत नाही" #: ../semanage/seobject.py:514 #, python-format msgid "Could not query user for %s" -msgstr "" +msgstr "%s साठी उपयोक्त्यास प्रश्न करू शकत नाही" #: ../semanage/seobject.py:543 ../semanage/seobject.py:547 #, python-format msgid "Could not modify SELinux user %s" -msgstr "" +msgstr "SELinux उपयोक्ता %s मध्ये बदल करता आले नाही" #: ../semanage/seobject.py:574 #, python-format msgid "SELinux user %s is defined in policy, cannot be deleted" -msgstr "" +msgstr "SELinux उपयोक्ता %s धोरणामध्ये व्याख्यीत आहे, नष्ट करता येणार नाही" #: ../semanage/seobject.py:582 ../semanage/seobject.py:586 #, python-format msgid "Could not delete SELinux user %s" -msgstr "" +msgstr "SELinux उपयोक्ता %s न\xE0\xA4\xB7्ट करता आला नाही" #: ../semanage/seobject.py:598 msgid "Could not list SELinux users" -msgstr "" +msgstr "SELinux उपयोक्त्यांची यादी करता आली नाही" #: ../semanage/seobject.py:604 #, python-format msgid "Could not list roles for user %s" -msgstr "" +msgstr "उपयोक्ता %s साठी भुमिकांची यादी करता आली नाही" #: ../semanage/seobject.py:638 msgid "Protocol udp or tcp is required" -msgstr "" +msgstr "प्रोटोकॉल udp किंवा tcp आवश्यक आहे" #: ../semanage/seobject.py:640 msgid "Port is required" -msgstr "" +msgstr "पोर्ट आवश्यक आहे" #: ../semanage/seobject.py:651 #, python-format msgid "Could not create a key for %s/%s" -msgstr "" +msgstr "%s/%s साठी कळ निर्माण करता आली नाही" #: ../semanage/seobject.py:662 -#, fuzzy msgid "Type is required" -msgstr "प्रकार" +msgstr "प्रकार आवश्यक आहे" #: ../semanage/seobject.py:668 ../semanage/seobject.py:730 #: ../semanage/seobject.py:764 ../semanage/seobject.py:770 #, python-format msgid "Could not check if port %s/%s is defined" -msgstr "" +msgstr "%s/%s पोर्ट व्याख्यीत आहे काय हे तपासता आले नाही" #: ../semanage/seobject.py:670 #, python-format msgid "Port %s/%s already defined" -msgstr "" +msgstr "पोर्ट %s/%s आधिच व्याख्यीत" #: ../semanage/seobject.py:674 #, python-format msgid "Could not create port for %s/%s" -msgstr "" +msgstr "%s/%s साठी पोर्ट निर्माण करता आले नाही" #: ../semanage/seobject.py:680 #, python-format msgid "Could not create context for %s/%s" -msgstr "" +msgstr "%s/%s साठी संदर्भ निर्माण करता आला नाही" #: ../semanage/seobject.py:684 #, python-format msgid "Could not set user in port context for %s/%s" -msgstr "" +msgstr "%s/%s च्या पोर्ट संदर्भात उपयोक्त्यास निर्धारित करता आले नाही" #: ../semanage/seobject.py:688 #, python-format msgid "Could not set role in port context for %s/%s" -msgstr "" +msgstr "%s/%s साठी पोर्ट संदर्भात भुमिका निर्धारित करता आली नाही" #: ../semanage/seobject.py:692 #, python-format msgid "Could not set type in port context for %s/%s" -msgstr "" +msgstr "%s/%s साठी पोर्ट संदर्भात प्रकार निर्धारित करता आला नाही" #: ../semanage/seobject.py:697 #, python-format msgid "Could not set mls fields in port context for %s/%s" -msgstr "" +msgstr "%s/%s साठी पोर्ट संदर्भात mls क्षेत्रे निर्धारित करता आली नाहीत" #: ../semanage/seobject.py:701 #, python-format msgid "Could not set port context for %s/%s" -msgstr "" +msgstr "%s/%s साठी पोर्ट संदर्भ निर्धारित करता आला नाही" #: ../semanage/seobject.py:709 ../semanage/seobject.py:713 #, python-format msgid "Could not add port %s/%s" -msgstr "" +msgstr "%s/%s पोर्ट जोडू शकत नाही" #: ../semanage/seobject.py:722 ../semanage/seobject.py:919 msgid "Requires setype or serange" -msgstr "" +msgstr "setype किंवा serange आवश्यक" #: ../semanage/seobject.py:724 msgid "Requires setype" -msgstr "" +msgstr "setype आवश्यक" #: ../semanage/seobject.py:732 ../semanage/seobject.py:766 #, python-format msgid "Port %s/%s is not defined" -msgstr "" +msgstr "पोर्ट %s/%s व्याख्यीत नाही" #: ../semanage/seobject.py:736 #, python-format msgid "Could not query port %s/%s" -msgstr "" +msgstr "पोर्ट %s/%s ला प्रश्न करता आले नाही" #: ../semanage/seobject.py:751 ../semanage/seobject.py:755 #, python-format msgid "Could not modify port %s/%s" -msgstr "" +msgstr "पोर्ट %s/%s मध्ये बदल करता आले नाहीत" #: ../semanage/seobject.py:772 #, python-format msgid "Port %s/%s is defined in policy, cannot be deleted" -msgstr "" +msgstr "पोर्ट %s/%s धोरणात व्याख्यीत आहे, नष्ट करता येणार नाही" #: ../semanage/seobject.py:780 ../semanage/seobject.py:784 #, python-format msgid "Could not delete port %s/%s" -msgstr "" +msgstr "पोर्ट %s/%s नष्ट करता आले नाही" #: ../semanage/seobject.py:792 ../semanage/seobject.py:811 msgid "Could not list ports" -msgstr "" +msgstr "पोर्टांची यादी करता आली नाही" #: ../semanage/seobject.py:855 ../semanage/seobject.py:1027 -#, fuzzy msgid "SELinux Type is required" -msgstr "प्रकार" +msgstr "SELinux प्रकार आवश्यक आहे" #: ../semanage/seobject.py:859 ../semanage/seobject.py:923 #: ../semanage/seobject.py:960 ../semanage/seobject.py:1031 #, python-format msgid "Could not create key for %s" -msgstr "" +msgstr "%s साठी कळ बनवू शकलो नाही" #: ../semanage/seobject.py:863 ../semanage/seobject.py:927 #: ../semanage/seobject.py:964 ../semanage/seobject.py:970 #, python-format msgid "Could not check if interface %s is defined" -msgstr "" +msgstr "इंटरफेस %s व्याख्यीत आहे काय हे तपासता आले नाही" #: ../semanage/seobject.py:865 #, python-format msgid "Interface %s already defined" -msgstr "" +msgstr "इंटरफेस %s आधिच व्याख्यीत" #: ../semanage/seobject.py:869 #, python-format msgid "Could not create interface for %s" -msgstr "" +msgstr "%s साठी इंटरफेस निर्माण करता आला नाही" #: ../semanage/seobject.py:874 ../semanage/seobject.py:1046 #, python-format msgid "Could not create context for %s" -msgstr "" +msgstr "%s साठी संदर्भ निर्माण करता आला नाही" #: ../semanage/seobject.py:878 #, python-format msgid "Could not set user in interface context for %s" -msgstr "" +msgstr "%s च्या इंटरफेस संदर्भात उपयोक्ता निर्धारित करता आला नाही" #: ../semanage/seobject.py:882 #, python-format msgid "Could not set role in interface context for %s" -msgstr "" +msgstr "%s च्या इंटरफेस संदर्भामध्ये भुमिका निर्धारित करता आली नाही" #: ../semanage/seobject.py:886 #, python-format msgid "Could not set type in interface context for %s" -msgstr "" +msgstr "%s च्या इंटरफेस संदर्भात प्रकार निर्धारित करता आला नाही" #: ../semanage/seobject.py:891 #, python-format msgid "Could not set mls fields in interface context for %s" -msgstr "" +msgstr "%s च्या इंटरफेस संदर्भात mls क्षेत्रे निर्धारित करता आली नाहीत" #: ../semanage/seobject.py:895 #, python-format msgid "Could not set interface context for %s" -msgstr "" +msgstr "%s साठी इंटरफेस संदर्भ निर्धारित करता आला नाही" #: ../semanage/seobject.py:899 #, python-format msgid "Could not set message context for %s" -msgstr "" +msgstr "%s साठी संदेश संदर्भ निर्धारित करता आला नाही" #: ../semanage/seobject.py:907 ../semanage/seobject.py:911 #, python-format msgid "Could not add interface %s" -msgstr "" +msgstr "इंटरफेस %s जमा करता आला नाही" #: ../semanage/seobject.py:929 ../semanage/seobject.py:966 #, python-format msgid "Interface %s is not defined" -msgstr "" +msgstr "इंटरफेस %s व्याख्यीत नाही" #: ../semanage/seobject.py:933 #, python-format msgid "Could not query interface %s" -msgstr "" +msgstr "इंटरफेस %s ला प्रश्न करता आले नाही" #: ../semanage/seobject.py:948 ../semanage/seobject.py:952 #, python-format msgid "Could not modify interface %s" -msgstr "" +msgstr "इंटरफेस %s मध्ये बदल करता आले नाही" #: ../semanage/seobject.py:972 #, python-format msgid "Interface %s is defined in policy, cannot be deleted" -msgstr "" +msgstr "इंटरफेस %s धोरणात व्य\xE0\xA4\xBEख्यीत आहे, नष्ट करता येणार नाही" #: ../semanage/seobject.py:980 ../semanage/seobject.py:984 #, python-format msgid "Could not delete interface %s" -msgstr "" +msgstr "इंटरफेस %s नष्ट करता आला नाही" #: ../semanage/seobject.py:992 msgid "Could not list interfaces" -msgstr "" +msgstr "इंटरफेसची यादी करता आली नाही" #: ../semanage/seobject.py:1035 ../semanage/seobject.py:1097 #: ../semanage/seobject.py:1136 ../semanage/seobject.py:1140 #, python-format msgid "Could not check if file context for %s is defined" -msgstr "" +msgstr "%s साठी संदर्भ फाइल व्याख्यीत आहे काय हे तपासता आले नाही" #: ../semanage/seobject.py:1037 #, python-format msgid "File context for %s already defined" -msgstr "" +msgstr "%s साठी फाइल संदर्भ आधिच व्य\xE0\xA4\xBEख्यीत" #: ../semanage/seobject.py:1041 #, python-format msgid "Could not create file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भ निर्माण करता आला नाही" #: ../semanage/seobject.py:1050 #, python-format msgid "Could not set user in file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भात उपयोक्ता निर्धारित करता आला नाही" #: ../semanage/seobject.py:1054 #, python-format msgid "Could not set role in file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भात भुमिका निर्धारित करता आली नाही" #: ../semanage/seobject.py:1058 #, python-format msgid "Could not set type in file context for %s" -msgstr "" +msgstr "%s च्या फाइल संदर्भात प्रकार निर्धआरित करता आला \xE0\xA4\xA8ाही" #: ../semanage/seobject.py:1063 #, python-format msgid "Could not set mls fields in file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भात mls क्षेत्रे निर्धारित करता आले नाहीत" #: ../semanage/seobject.py:1069 #, python-format msgid "Could not set file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भ निर्धारित करता आला नाही" #: ../semanage/seobject.py:1077 ../semanage/seobject.py:1081 #, python-format msgid "Could not add file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भ जोडता आला नाही" #: ../semanage/seobject.py:1089 msgid "Requires setype, serange or seuser" -msgstr "" +msgstr "setype, serange किंवा seuser आवश्यक" #: ../semanage/seobject.py:1099 ../semanage/seobject.py:1144 #, python-format msgid "File context for %s is not defined" -msgstr "" +msgstr "%s साठी फाइल संदर्भ व्याख्यीत नाही" #: ../semanage/seobject.py:1103 #, python-format msgid "Could not query file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भास प्रश्न करता आले नाही" #: ../semanage/seobject.py:1120 ../semanage/seobject.py:1124 #, python-format msgid "Could not modify file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भात बदल करता आले नाही" #: ../semanage/seobject.py:1142 #, python-format msgid "File context for %s is defined in policy, cannot be deleted" -msgstr "" +msgstr "%s साठी फाइल संदर्भ धोरणात व्याख्यीत, नष्ट करता येणार नाही" #: ../semanage/seobject.py:1152 ../semanage/seobject.py:1156 #, python-format msgid "Could not delete file context for %s" -msgstr "" +msgstr "%s साठी फाइल संदर्भ नष्ट करता आला नाही" #: ../semanage/seobject.py:1164 msgid "Could not list file contexts" -msgstr "" +msgstr "फाइल संदर्भांची यादी करता आली नाही" #: ../semanage/seobject.py:1168 -#, fuzzy msgid "Could not list local file contexts" -msgstr "exec संदर्भ %s वर निर्धारित करता आला नाही.\n" +msgstr "स्थानिक फाइल संदर्भांची यादी करता आली नाही" #: ../semanage/seobject.py:1203 msgid "Requires value" -msgstr "" +msgstr "मूल्य आवश्यक" #: ../semanage/seobject.py:1211 ../semanage/seobject.py:1245 #: ../semanage/seobject.py:1251 #, python-format msgid "Could not check if boolean %s is defined" -msgstr "" +msgstr "boolean %s व्याख्यीत आहे काय हे तपासता आले नाही" #: ../semanage/seobject.py:1213 ../semanage/seobject.py:1247 #, python-format msgid "Boolean %s is not defined" -msgstr "" +msgstr "boolean %s व्याख्यीत नाही" #: ../semanage/seobject.py:1217 #, python-format msgid "Could not query file context %s" -msgstr "" +msgstr "फाइल संदर्भ %s ला प्रश्न करता आले नाही" #: ../semanage/seobject.py:1229 ../semanage/seobject.py:1233 #, python-format msgid "Could not modify boolean %s" -msgstr "" +msgstr "boolean %s मध्ये बदल करता आले नाही" #: ../semanage/seobject.py:1253 #, python-format msgid "Boolean %s is defined in policy, cannot be deleted" -msgstr "" +msgstr "boolean %s धोरणात व्याख्यीत आहे, नष्ट करता येणार नाही" #: ../semanage/seobject.py:1261 ../semanage/seobject.py:1265 #, python-format msgid "Could not delete boolean %s" -msgstr "" +msgstr "boolean %s नष्ट करता आले नाही" #: ../semanage/seobject.py:1273 msgid "Could not list booleans" -msgstr "" +msgstr "booleans ची यादी करता आली नाही" #: ../audit2allow/audit2allow:183 #, c-format msgid "Generating type enforcment file: %s.te" -msgstr "" +msgstr "प्रकार बलप्रविष्ट फाइल उत्पन्न करत आहे: %s.te" #: ../audit2allow/audit2allow:189 ../audit2allow/audit2allow:194 msgid "Compiling policy" -msgstr "" +msgstr "धोरम कंपाइल करत आहे" #: ../audit2allow/audit2allow:205 msgid "" "\n" "******************** IMPORTANT ***********************\n" msgstr "" +"\n" +"******************** महत्वाचे ***********************\n" #: ../audit2allow/audit2allow:206 #, c-format @@ -1026,8 +1028,14 @@ "semodule -i %s.pp\n" "\n" msgstr "" +"हे नव्याने बनवलेले धोरण संकुल कर\xE0\xA5\x8Dनलमध्ये भारित करण्यासाठी,\n" +"तुम्हास हे चालवावे लागेल \n" +"\n" +"semodule -i %s.pp\n" +"\n" #: ../audit2allow/audit2allow:211 -#, fuzzy, c-format +#, c-format msgid "Options Error: %s " -msgstr "चूक " +msgstr "पर्याय चूक: %s" + Modified: branches/stable/1_0/policycoreutils/po/ms.po =================================================================== --- branches/stable/1_0/policycoreutils/po/ms.po 2007-02-21 17:19:31 UTC (rev 2249) +++ branches/stable/1_0/policycoreutils/po/ms.po 2007-02-21 17:38:15 UTC (rev 2250) @@ -8,7 +8,7 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-11-21 14:21-0500\n" -"PO-Revision-Date: 2006-11-19 22:09+0800\n" +"PO-Revision-Date: 2007-01-22 01:13+0800\n" "Last-Translator: Sharuzzaman Ahmat Raslan <sha...@my...>\n" "Language-Team: LANGUAGE <LL...@li...>\n" "MIME-Version: 1.0\n" @@ -30,16 +30,19 @@ msgid "failed to set PAM_TTY\n" msgstr "PAM: gagal untuk melepaskan pengesah." -#: ../newrole/newrole.c:218 ../run_init/run_init.c:162 +#: ../newrole/newrole.c:218 +#: ../run_init/run_init.c:162 msgid "Password:" msgstr "Katalaluan:" -#: ../newrole/newrole.c:243 ../run_init/run_init.c:197 +#: ../newrole/newrole.c:243 +#: ../run_init/run_init.c:197 #, c-format msgid "Cannot find your entry in the shadow passwd file.\n" msgstr "" -#: ../newrole/newrole.c:250 ../run_init/run_init.c:203 +#: ../newrole/newrole.c:250 +#: ../run_init/run_init.c:203 #, c-format msgid "getpass cannot open /dev/tty\n" msgstr "" @@ -60,36 +63,42 @@ msgstr "Ralat - nama kumpulan volum %s adalah tidak sah." #: ../newrole/newrole.c:389 -#, c-format +#, fuzzy, c-format msgid "Unable to clear environment\n" -msgstr "" +msgstr "RALAT: Tidak boleh menginitialisasikan persekitaran grafikal." -#: ../newrole/newrole.c:436 ../newrole/newrole.c:513 +#: ../newrole/newrole.c:436 +#: ../newrole/newrole.c:513 #, c-format msgid "Error initing capabilities, aborting.\n" msgstr "" -#: ../newrole/newrole.c:444 ../newrole/newrole.c:519 +#: ../newrole/newrole.c:444 +#: ../newrole/newrole.c:519 #, fuzzy, c-format msgid "Error setting capabilities, aborting\n" -msgstr "Terdapat ralat RPM. Mesejnya ialah:\n" +msgstr "ralat menetapkan sifat terminal" #: ../newrole/newrole.c:450 -#, c-format +#, fuzzy, c-format msgid "Error setting KEEPCAPS, aborting\n" -msgstr "" +msgstr "ralat menetapkan sifat terminal" -#: ../newrole/newrole.c:458 ../newrole/newrole.c:531 +#: ../newrole/newrole.c:458 +#: ../newrole/newrole.c:531 #, c-format msgid "Error dropping capabilities, aborting\n" msgstr... [truncated message content] |
From: <ssm...@us...> - 2007-02-21 17:41:09
|
Revision: 2252 http://svn.sourceforge.net/selinux/?rev=2252&view=rev Author: ssmalley Date: 2007-02-21 09:41:07 -0800 (Wed, 21 Feb 2007) Log Message: ----------- Updated ChangeLogs and VERSIONs. Modified Paths: -------------- branches/stable/1_0/libselinux/ChangeLog branches/stable/1_0/libselinux/VERSION branches/stable/1_0/policycoreutils/ChangeLog branches/stable/1_0/policycoreutils/VERSION Modified: branches/stable/1_0/libselinux/ChangeLog =================================================================== --- branches/stable/1_0/libselinux/ChangeLog 2007-02-21 17:40:51 UTC (rev 2251) +++ branches/stable/1_0/libselinux/ChangeLog 2007-02-21 17:41:07 UTC (rev 2252) @@ -1,3 +1,6 @@ +1.34.4 2007-02-21 + * Merged more swig initializers from Dan Walsh. + 1.34.3 2007-02-20 * Merged patch from Todd Miller to convert int types over to C99 style. Modified: branches/stable/1_0/libselinux/VERSION =================================================================== --- branches/stable/1_0/libselinux/VERSION 2007-02-21 17:40:51 UTC (rev 2251) +++ branches/stable/1_0/libselinux/VERSION 2007-02-21 17:41:07 UTC (rev 2252) @@ -1 +1 @@ -1.34.3 +1.34.4 Modified: branches/stable/1_0/policycoreutils/ChangeLog =================================================================== --- branches/stable/1_0/policycoreutils/ChangeLog 2007-02-21 17:40:51 UTC (rev 2251) +++ branches/stable/1_0/policycoreutils/ChangeLog 2007-02-21 17:41:07 UTC (rev 2252) @@ -1,3 +1,9 @@ +1.34.3 2007-02-21 + * Merged translations update from Dan Walsh. + * Merged chcat fixes from Dan Walsh. + * Merged man page fixes from Dan Walsh. + * Merged seobject prefix validity checking from Dan Walsh. + 1.34.2 2007-02-20 * Merged seobject exception handler fix from Caleb Case. * Merged setfiles memory leak patch from Todd Miller. Modified: branches/stable/1_0/policycoreutils/VERSION =================================================================== --- branches/stable/1_0/policycoreutils/VERSION 2007-02-21 17:40:51 UTC (rev 2251) +++ branches/stable/1_0/policycoreutils/VERSION 2007-02-21 17:41:07 UTC (rev 2252) @@ -1 +1 @@ -1.34.2 +1.34.3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-02-22 13:59:49
|
Revision: 2257 http://svn.sourceforge.net/selinux/?rev=2257&view=rev Author: ssmalley Date: 2007-02-22 05:59:48 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Ported r2253 through r2255 from trunk. Modified Paths: -------------- branches/stable/1_0/libselinux/src/matchpathcon.c branches/stable/1_0/policycoreutils/restorecond/restorecond.c branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.c branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.h Modified: branches/stable/1_0/libselinux/src/matchpathcon.c =================================================================== --- branches/stable/1_0/libselinux/src/matchpathcon.c 2007-02-22 13:54:45 UTC (rev 2256) +++ branches/stable/1_0/libselinux/src/matchpathcon.c 2007-02-22 13:59:48 UTC (rev 2257) @@ -445,9 +445,9 @@ { int items, len, regerr, ret; char *buf_p, *ptr; - char *regex, *type, *context; + char *regex=NULL, *type=NULL, *context=NULL; const char *reg_buf; - char *anchored_regex; + char *anchored_regex = NULL; ret = 0; len = strlen(line_buf); @@ -488,8 +488,8 @@ if (type) { type = strdup(type); if (!type) { - ret = -1; - goto finish; + free(regex); + return -1; } } context = strdup(context); @@ -543,9 +543,12 @@ path, lineno, anchored_regex, (errbuf ? errbuf : "out of memory")); free(anchored_regex); + anchored_regex = NULL; + free(errbuf); goto finish; } free(anchored_regex); + anchored_regex = NULL; /* Convert the type string to a mode format */ spec_arr[nspec].type_str = type; @@ -718,6 +721,7 @@ } } free(line_buf); + line_buf = NULL; /* Move exact pathname specifications to the end. */ spec_copy = malloc(sizeof(spec_t) * nspec); @@ -740,6 +744,7 @@ status = 0; finish: fclose(fp); + free(line_buf); if (spec_arr != spec_copy) free(spec_arr); if (homedirfp) Modified: branches/stable/1_0/policycoreutils/restorecond/restorecond.c =================================================================== --- branches/stable/1_0/policycoreutils/restorecond/restorecond.c 2007-02-22 13:54:45 UTC (rev 2256) +++ branches/stable/1_0/policycoreutils/restorecond/restorecond.c 2007-02-22 13:59:48 UTC (rev 2257) @@ -481,6 +481,8 @@ watch_list_free(master_fd); close(master_fd); + matchpathcon_fini(); + utmpwatcher_free(); if (pidfile) unlink(pidfile); Modified: branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.c =================================================================== --- branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.c 2007-02-22 13:54:45 UTC (rev 2256) +++ branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.c 2007-02-22 13:59:48 UTC (rev 2257) @@ -101,6 +101,12 @@ watch_file(inotify_fd, path); } +void utmpwatcher_free(void) +{ + if (utmp_ptr) + strings_list_free(utmp_ptr); +} + #ifdef TEST int main(int argc, char **argv) { Modified: branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.h =================================================================== --- branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.h 2007-02-22 13:54:45 UTC (rev 2256) +++ branches/stable/1_0/policycoreutils/restorecond/utmpwatcher.h 2007-02-22 13:59:48 UTC (rev 2257) @@ -25,5 +25,6 @@ unsigned int utmpwatcher_handle(int inotify_fd, int wd); void utmpwatcher_add(int inotify_fd, const char *path); +void utmpwatcher_free(void); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-02-22 14:03:32
|
Revision: 2258 http://svn.sourceforge.net/selinux/?rev=2258&view=rev Author: ssmalley Date: 2007-02-22 06:03:31 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Updated VERSIONs and ChangeLogs. Modified Paths: -------------- branches/stable/1_0/libselinux/ChangeLog branches/stable/1_0/libselinux/VERSION branches/stable/1_0/policycoreutils/ChangeLog branches/stable/1_0/policycoreutils/VERSION Modified: branches/stable/1_0/libselinux/ChangeLog =================================================================== --- branches/stable/1_0/libselinux/ChangeLog 2007-02-22 13:59:48 UTC (rev 2257) +++ branches/stable/1_0/libselinux/ChangeLog 2007-02-22 14:03:31 UTC (rev 2258) @@ -1,3 +1,6 @@ +1.34.5 2007-02-22 + * Merged matchpathcon memory leak fix from Steve Grubb. + 1.34.4 2007-02-21 * Merged more swig initializers from Dan Walsh. Modified: branches/stable/1_0/libselinux/VERSION =================================================================== --- branches/stable/1_0/libselinux/VERSION 2007-02-22 13:59:48 UTC (rev 2257) +++ branches/stable/1_0/libselinux/VERSION 2007-02-22 14:03:31 UTC (rev 2258) @@ -1 +1 @@ -1.34.4 +1.34.5 Modified: branches/stable/1_0/policycoreutils/ChangeLog =================================================================== --- branches/stable/1_0/policycoreutils/ChangeLog 2007-02-22 13:59:48 UTC (rev 2257) +++ branches/stable/1_0/policycoreutils/ChangeLog 2007-02-22 14:03:31 UTC (rev 2258) @@ -1,3 +1,6 @@ +1.34.4 2007-02-22 + * Merged restorecond memory leak fix from Steve Grubb. + 1.34.3 2007-02-21 * Merged translations update from Dan Walsh. * Merged chcat fixes from Dan Walsh. Modified: branches/stable/1_0/policycoreutils/VERSION =================================================================== --- branches/stable/1_0/policycoreutils/VERSION 2007-02-22 13:59:48 UTC (rev 2257) +++ branches/stable/1_0/policycoreutils/VERSION 2007-02-22 14:03:31 UTC (rev 2258) @@ -1 +1 @@ -1.34.3 +1.34.4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-04-12 18:58:01
|
Revision: 2348 http://svn.sourceforge.net/selinux/?rev=2348&view=rev Author: ssmalley Date: 2007-04-12 11:57:59 -0700 (Thu, 12 Apr 2007) Log Message: ----------- Ported r2340 (libselinux: rpm_execcon python binding fix, getsebool -a EACCES handling, matchpathcon man page fix) and r2342 (checkpolicy: checkmodule man page fix) from trunk. Modified Paths: -------------- branches/stable/1_0/checkpolicy/checkmodule.8 branches/stable/1_0/libselinux/man/man8/matchpathcon.8 branches/stable/1_0/libselinux/src/selinuxswig.i branches/stable/1_0/libselinux/src/selinuxswig_wrap.c branches/stable/1_0/libselinux/utils/getsebool.c Modified: branches/stable/1_0/checkpolicy/checkmodule.8 =================================================================== --- branches/stable/1_0/checkpolicy/checkmodule.8 2007-04-12 18:54:14 UTC (rev 2347) +++ branches/stable/1_0/checkpolicy/checkmodule.8 2007-04-12 18:57:59 UTC (rev 2348) @@ -3,7 +3,7 @@ checkmodule \- SELinux policy module compiler .SH SYNOPSIS .B checkmodule -.I "[-b] [-d] [-m] [-M] [-o output_file] [input_file]" +.I "[-b] [-m] [-M] [-V] [-o output_file] [input_file]" .SH "DESCRIPTION" This manual page describes the .BR checkmodule @@ -25,16 +25,15 @@ Read an existing binary policy module file rather than a source policy module file. This option is a development/debugging aid. .TP -.B \-d -Enter debug mode after loading the policy. This option is a -development/debugging aid. -.TP .B \-m Generate a non-base policy module. .TP .B \-M Enable the MLS/MCS support when checking and compiling the policy module. .TP +.B \-V + Show policy versions created by this program +.TP .B \-o filename Write a binary policy module file to the specified filename. Otherwise, checkmodule will only check the syntax of the module source file Modified: branches/stable/1_0/libselinux/man/man8/matchpathcon.8 =================================================================== --- branches/stable/1_0/libselinux/man/man8/matchpathcon.8 2007-04-12 18:54:14 UTC (rev 2347) +++ branches/stable/1_0/libselinux/man/man8/matchpathcon.8 2007-04-12 18:57:59 UTC (rev 2348) @@ -28,4 +28,4 @@ .SH "SEE ALSO" .BR selinux "(8), " -.BR mathpathcon "(3), " +.BR matchpathcon "(3), " Modified: branches/stable/1_0/libselinux/src/selinuxswig.i =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig.i 2007-04-12 18:54:14 UTC (rev 2347) +++ branches/stable/1_0/libselinux/src/selinuxswig.i 2007-04-12 18:57:59 UTC (rev 2348) @@ -115,9 +115,38 @@ extern const char *selinux_path(void); extern int selinux_check_passwd_access(access_vector_t requested); extern int checkPasswdAccess(access_vector_t requested); + +// This tells SWIG to treat char ** as a special case +%typemap(python,in) char ** { + /* Check if is a list */ + if (PyList_Check($input)) { + int size = PyList_Size($input); + int i = 0; + $1 = (char **) malloc((size+1)*sizeof(char *)); + if ($1 == NULL) { + PyErr_SetString(PyExc_MemoryError,"Out of memory"); + return NULL; + } + for (i = 0; i < size; i++) { + PyObject *o = PyList_GetItem($input,i); + if (PyString_Check(o)) + $1[i] = PyString_AsString(PyList_GetItem($input,i)); + else { + PyErr_SetString(PyExc_TypeError,"list must contain strings"); + free($1); + return NULL; + } + } + $1[i] = 0; + } else { + PyErr_SetString(PyExc_TypeError,"not a list"); + return NULL; + } +} + extern int rpm_execcon(unsigned int verified, const char *filename, - char *const argv[], char *const envp[]); + char **, char **); extern int is_context_customizable (security_context_t scontext); Modified: branches/stable/1_0/libselinux/src/selinuxswig_wrap.c =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-04-12 18:54:14 UTC (rev 2347) +++ branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-04-12 18:57:59 UTC (rev 2348) @@ -4145,18 +4145,14 @@ PyObject *resultobj = 0; unsigned int arg1 ; char *arg2 = (char *) 0 ; - char **arg3 ; - char **arg4 ; + char **arg3 = (char **) 0 ; + char **arg4 = (char **) 0 ; int result; unsigned int val1 ; int ecode1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -4173,17 +4169,59 @@ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rpm_execcon" "', argument " "2"" of type '" "char const *""'"); } 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 []""'"); - } - arg3 = (char **)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_char, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "rpm_execcon" "', argument " "4"" of type '" "char *const []""'"); - } - arg4 = (char **)(argp4); - result = (int)rpm_execcon(arg1,(char const *)arg2,(char *const (*))arg3,(char *const (*))arg4); + { + /* Check if is a list */ + if (PyList_Check(obj2)) { + int size = PyList_Size(obj2); + int i = 0; + arg3 = (char **) malloc((size+1)*sizeof(char *)); + if (arg3 == NULL) { + PyErr_SetString(PyExc_MemoryError,"Out of memory"); + return NULL; + } + for (i = 0; i < size; i++) { + PyObject *o = PyList_GetItem(obj2,i); + if (PyString_Check(o)) + arg3[i] = PyString_AsString(PyList_GetItem(obj2,i)); + else { + PyErr_SetString(PyExc_TypeError,"list must contain strings"); + free(arg3); + return NULL; + } + } + arg3[i] = 0; + } else { + PyErr_SetString(PyExc_TypeError,"not a list"); + return NULL; + } + } + { + /* Check if is a list */ + if (PyList_Check(obj3)) { + int size = PyList_Size(obj3); + int i = 0; + arg4 = (char **) malloc((size+1)*sizeof(char *)); + if (arg4 == NULL) { + PyErr_SetString(PyExc_MemoryError,"Out of memory"); + return NULL; + } + for (i = 0; i < size; i++) { + PyObject *o = PyList_GetItem(obj3,i); + if (PyString_Check(o)) + arg4[i] = PyString_AsString(PyList_GetItem(obj3,i)); + else { + PyErr_SetString(PyExc_TypeError,"list must contain strings"); + free(arg4); + return NULL; + } + } + arg4[i] = 0; + } else { + PyErr_SetString(PyExc_TypeError,"not a list"); + return NULL; + } + } + result = (int)rpm_execcon(arg1,(char const *)arg2,arg3,arg4); resultobj = SWIG_From_int((int)(result)); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; Modified: branches/stable/1_0/libselinux/utils/getsebool.c =================================================================== --- branches/stable/1_0/libselinux/utils/getsebool.c 2007-04-12 18:54:14 UTC (rev 2347) +++ branches/stable/1_0/libselinux/utils/getsebool.c 2007-04-12 18:57:59 UTC (rev 2348) @@ -14,7 +14,7 @@ int main(int argc, char **argv) { - int i, rc = 0, active, pending, len = 0, opt; + int i, get_all = 0, rc = 0, active, pending, len = 0, opt; char **names; while ((opt = getopt(argc, argv, "a")) > 0) { @@ -39,6 +39,7 @@ printf("No booleans\n"); return 0; } + get_all = 1; break; default: usage(argv[0]); @@ -72,6 +73,8 @@ for (i = 0; i < len; i++) { active = security_get_boolean_active(names[i]); if (active < 0) { + if (get_all && errno == EACCES) + continue; fprintf(stderr, "Error getting active value for %s\n", names[i]); rc = -1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-04-12 19:02:32
|
Revision: 2349 http://svn.sourceforge.net/selinux/?rev=2349&view=rev Author: ssmalley Date: 2007-04-12 12:02:31 -0700 (Thu, 12 Apr 2007) Log Message: ----------- Updated ChangeLog and VERSION. Modified Paths: -------------- branches/stable/1_0/checkpolicy/ChangeLog branches/stable/1_0/libselinux/ChangeLog branches/stable/1_0/libselinux/VERSION branches/stable/1_0/policycoreutils/ChangeLog branches/stable/1_0/policycoreutils/VERSION Modified: branches/stable/1_0/checkpolicy/ChangeLog =================================================================== --- branches/stable/1_0/checkpolicy/ChangeLog 2007-04-12 18:57:59 UTC (rev 2348) +++ branches/stable/1_0/checkpolicy/ChangeLog 2007-04-12 19:02:31 UTC (rev 2349) @@ -1,3 +1,6 @@ +1.34.2 2007-04-12 + * Merged checkmodule man page fix from Dan Walsh. + 1.34.1 2007-02-20 * Merged patch to allow dots in class identifiers from Caleb Case. Modified: branches/stable/1_0/libselinux/ChangeLog =================================================================== --- branches/stable/1_0/libselinux/ChangeLog 2007-04-12 18:57:59 UTC (rev 2348) +++ branches/stable/1_0/libselinux/ChangeLog 2007-04-12 19:02:31 UTC (rev 2349) @@ -1,3 +1,8 @@ +1.34.8 2007-04-12 + * Merged rpm_execcon python binding fix, matchpathcon man page fix, and getsebool -a handling for EACCES from Dan Walsh. + * Merged userspace AVC patch to follow kernel's behavior for permissive mode in caching previous denials from Eamon Walsh. + * Merged sidput(NULL) patch from Eamon Walsh. + 1.34.7 2007-03-20 * Merged fix for avc.h #include's from Eamon Walsh. Modified: branches/stable/1_0/libselinux/VERSION =================================================================== --- branches/stable/1_0/libselinux/VERSION 2007-04-12 18:57:59 UTC (rev 2348) +++ branches/stable/1_0/libselinux/VERSION 2007-04-12 19:02:31 UTC (rev 2349) @@ -1 +1 @@ -1.34.7 +1.34.8 Modified: branches/stable/1_0/policycoreutils/ChangeLog =================================================================== --- branches/stable/1_0/policycoreutils/ChangeLog 2007-04-12 18:57:59 UTC (rev 2348) +++ branches/stable/1_0/policycoreutils/ChangeLog 2007-04-12 19:02:31 UTC (rev 2349) @@ -1,3 +1,6 @@ +1.34.7 2007-04-12 + * Merged seobject setransRecords patch to return the first alias from Xavier Toth. + 1.34.6 2007-03-01 * Merged restorecond init script LSB compliance patch from Steve Grubb. Modified: branches/stable/1_0/policycoreutils/VERSION =================================================================== --- branches/stable/1_0/policycoreutils/VERSION 2007-04-12 18:57:59 UTC (rev 2348) +++ branches/stable/1_0/policycoreutils/VERSION 2007-04-12 19:02:31 UTC (rev 2349) @@ -1 +1 @@ -1.34.6 +1.34.7 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-04-13 18:06:48
|
Revision: 2357 http://svn.sourceforge.net/selinux/?rev=2357&view=rev Author: ssmalley Date: 2007-04-13 11:06:47 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Ported r2355 (fix build) from trunk. Modified Paths: -------------- branches/stable/1_0/checkpolicy/test/Makefile branches/stable/1_0/policycoreutils/secon/Makefile Modified: branches/stable/1_0/checkpolicy/test/Makefile =================================================================== --- branches/stable/1_0/checkpolicy/test/Makefile 2007-04-13 18:05:27 UTC (rev 2356) +++ branches/stable/1_0/checkpolicy/test/Makefile 2007-04-13 18:06:47 UTC (rev 2357) @@ -9,7 +9,7 @@ CFLAGS ?= -g -Wall -O2 -pipe override CFLAGS += -I$(INCLUDEDIR) -LDLIBS=-lfl -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR) +LDLIBS=-lfl -lsepol -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR) all: dispol dismod Modified: branches/stable/1_0/policycoreutils/secon/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/secon/Makefile 2007-04-13 18:05:27 UTC (rev 2356) +++ branches/stable/1_0/policycoreutils/secon/Makefile 2007-04-13 18:06:47 UTC (rev 2357) @@ -9,7 +9,7 @@ VERSION = $(shell cat ../VERSION) CFLAGS ?= $(WARNS) -O1 override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) -LDLIBS = -lselinux -L$(LIBDIR) +LDLIBS = -lsepol -lselinux -L$(LIBDIR) all: secon This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Joshua B. <me...@ma...> - 2007-04-19 15:40:33
|
ssm...@us... wrote: > Revision: 2357 > http://svn.sourceforge.net/selinux/?rev=2357&view=rev > Author: ssmalley > Date: 2007-04-13 11:06:47 -0700 (Fri, 13 Apr 2007) > > Log Message: > ----------- > Ported r2355 (fix build) from trunk. > > Modified Paths: > -------------- > branches/stable/1_0/checkpolicy/test/Makefile > branches/stable/1_0/policycoreutils/secon/Makefile > > Modified: branches/stable/1_0/checkpolicy/test/Makefile > =================================================================== > --- branches/stable/1_0/checkpolicy/test/Makefile 2007-04-13 18:05:27 UTC (rev 2356) > +++ branches/stable/1_0/checkpolicy/test/Makefile 2007-04-13 18:06:47 UTC (rev 2357) > @@ -9,7 +9,7 @@ > CFLAGS ?= -g -Wall -O2 -pipe > override CFLAGS += -I$(INCLUDEDIR) > > -LDLIBS=-lfl -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR) > +LDLIBS=-lfl -lsepol -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR) > > all: dispol dismod > > > Modified: branches/stable/1_0/policycoreutils/secon/Makefile > =================================================================== > --- branches/stable/1_0/policycoreutils/secon/Makefile 2007-04-13 18:05:27 UTC (rev 2356) > +++ branches/stable/1_0/policycoreutils/secon/Makefile 2007-04-13 18:06:47 UTC (rev 2357) > @@ -9,7 +9,7 @@ > VERSION = $(shell cat ../VERSION) > CFLAGS ?= $(WARNS) -O1 > override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) > -LDLIBS = -lselinux -L$(LIBDIR) > +LDLIBS = -lsepol -lselinux -L$(LIBDIR) > > all: secon > > > Is there a reason that you didn't make stable tags of these last few updates to the stable branch? |
From: <kma...@us...> - 2007-04-27 15:43:49
|
Revision: 2410 http://svn.sourceforge.net/selinux/?rev=2410&view=rev Author: kmacmillan Date: 2007-04-27 08:43:48 -0700 (Fri, 27 Apr 2007) Log Message: ----------- add scripts directory and selinux-maint Added Paths: ----------- branches/stable/1_0/scripts/ branches/stable/1_0/scripts/Lindent branches/stable/1_0/scripts/selinux-maint Removed Paths: ------------- branches/stable/1_0/Lindent Deleted: branches/stable/1_0/Lindent =================================================================== --- branches/stable/1_0/Lindent 2007-04-27 15:42:58 UTC (rev 2409) +++ branches/stable/1_0/Lindent 2007-04-27 15:43:48 UTC (rev 2410) @@ -1,2 +0,0 @@ -#!/bin/sh -indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" Added: branches/stable/1_0/scripts/Lindent =================================================================== --- branches/stable/1_0/scripts/Lindent (rev 0) +++ branches/stable/1_0/scripts/Lindent 2007-04-27 15:43:48 UTC (rev 2410) @@ -0,0 +1,2 @@ +#!/bin/sh +indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" Property changes on: branches/stable/1_0/scripts/Lindent ___________________________________________________________________ Name: svn:executable + * Added: branches/stable/1_0/scripts/selinux-maint =================================================================== --- branches/stable/1_0/scripts/selinux-maint (rev 0) +++ branches/stable/1_0/scripts/selinux-maint 2007-04-27 15:43:48 UTC (rev 2410) @@ -0,0 +1,221 @@ +#! /usr/bin/python + +# Basic instructions +# +# 1. Save patch email to file [patch.email] +# +# 2. Go to the svn directory to which you want to apply the patch. +# +# 3. Run "selinux-maint split patch.email". This will run vi on the +# logmsg (pulled out of the email) to allow you to add anything (ack +# messages). When you quit vi the current directory will have files +# called "patch" and "logmsg". +# +# 4. Run "selinux-maint apply" (optionally with a strip level as +# the last argument). This will do a dry run of applying the patch +# showing the results and ask if you want to apply the patch. If you +# say yes it will apply the patch and attempt to detect file adds (by +# comparing svn status and the output of patch). If it finds adds it +# will ask if you want to add each file. +# +# 5. Run "selinux-maint commit" to commit that patch with the log +# message. +# +# 6. Repeat 4 and 5 as often as necessary for a set of patch emails. +# +# 7. Run "selinux-maint rev packagename" where packagename is +# something like "libsepol". This will prompt for the new version +# number (showing the current), update VERSION, add a Changelog entry +# with the version and date, and vi the changelog for you to add +# entries. +# +# 8. Run "selinux-maint commit" again to commit the revision change +# (rev adds a simple log message - I just fixed this as my last +# checkin had the wrong log message). + +import sys +import subprocess +import shutil +import os +import os.path +import datetime + +dir = "/tmp/selinux-maint/" + +def usage(): + print "selinux-maint [command] [options]" + print "" + print "commands:" + print "\tsplit patch-email: split patch-email into a patch and log message" + print "\tapply [patch-level]: apply the patch and logmsg with optional level" + print "\tcommit username: commit the changes" + print "\trev package: update the version number and changelog of package" + +def create_tmpdir(): + try: + os.mkdir(dir) + except OSError: + if not os.path.isdir(dir): + print "path %s exists and is not a directory" % dir + sys.exit(1) + +def split_email(args): + # Get an absolute path for the patch email since we are going to + # change the working directory + patch_path = os.path.abspath(args[0]) + + create_tmpdir() + prevdir = os.getcwd() + os.chdir(dir) + + infd = open(patch_path) + outfd = open("info", "w") + retcode = subprocess.call(["git-mailinfo", "msg", "patch"], stdin=infd, + stdout=outfd) + if retcode != 0: + sys.exit(1) + + msgfd = open("logmsg", "w") + retcode = subprocess.call(["cat", "info", "msg"], stdout=msgfd) + + msgfd.close() + + retcode = subprocess.call(["vi", "logmsg"]) + + shutil.copyfile("logmsg", prevdir + "/logmsg") + shutil.copyfile("patch", prevdir + "/patch") + +def apply(args): + if len(args): + patch_level = "-p%d" % int(args[0]) + else: + patch_level = "-p1" + + print "Test applying patch:" + patchfd = open("patch") + retcode = subprocess.call(["patch", patch_level, "--dry-run"], stdin=patchfd) + resp = raw_input("apply [y/n]: ") + if resp != "y": + sys.exit(0) + + patchfd = open("patch") + patch_output = subprocess.Popen(["patch", patch_level], stdin=patchfd, + stdout=subprocess.PIPE).communicate()[0] + + status_output = subprocess.Popen(["svn", "status"], stdout=subprocess.PIPE).communicate()[0] + + + # Detect adds + unknown_files = [] + for status_line in status_output.split("\n"): + try: + status, fname = status_line.split() + except ValueError: + continue + if status == "?": + unknown_files.append(fname) + + added_files = [] + for patch_line in patch_output.split("\n"): + try: + patched_fname = patch_line.split(" ")[2] + except: + continue + if patched_fname in unknown_files: + added_files.append(patched_fname) + + for fname in added_files: + input = raw_input("add file %s [y/n]: " % fname) + if input == "y": + subprocess.call(["svn", "add", fname]) + +def commit(args): + if len(args) != 1: + print "you must provide a username" + usage() + sys.exit(1) + retcode = subprocess.call(["svn", "commit", "--username", args[0], "-F", "logmsg"]) + +def rev(args): + if len(args) != 1: + print "you must provide a package name" + usage() + sys.exit(1) + package = args[0] + + ver_fd = open("%s/VERSION" % package, "r") + cur = ver_fd.read() + cur = cur.split("\n")[0] + ver_fd.close() + input = raw_input("new version [current is %s]: " % cur) + new_fd = open("%s/VERSION.new" % package, "w") + new_fd.write(input + "\n") + new_fd.close() + shutil.copyfile("%s/VERSION.new" % package, "%s/VERSION" % package) + + old_changelog = "%s/ChangeLog" % package + new_changelog = "%s/ChangeLog.new" % package + + n = open(new_changelog, "w") + + entry = "%s %s\n" % (input, str(datetime.date.today())) + n.write(entry) + n.write("\t*\n\n") + o = open(old_changelog) + n.write(o.read()) + n.close() + o.close() + + subprocess.call(["vi", new_changelog]) + shutil.copyfile(new_changelog, old_changelog) + + logmsg = open("logmsg", "w") + logmsg.write("updated %s to version %s\n" % (package, input)) + +def merge(args): + if len(args) != 2: + print "you must provide a revision pair and source branch" + usage() + sys.exit(1) + + rev = args[0] + branch = args[1] + + if branch == "trunk": + url = "https://selinux.svn.sourceforge.net/svnroot/selinux/trunk" + elif branch == "stable": + url = "https://selinux.svn.sourceforge.net/svnroot/selinux/branches/stable/1_0" + else: + url = "https://selinux.svn.sourceforge.net/svnroot/selinux/branches/%s" % branch + + subprocess.call(["svn", "diff", "-r%s" % rev, url]) + input = raw_input("apply these changes [y/n]? ") + if input != "y": + sys.exit(0) + + subprocess.call(["svn", "merge", "-r%s" % rev, url]) + + logmsg = open("logmsg", "w") + logmsg.write("applied r%s from %s\n" % (rev, branch)) + + +def main(): + if len(sys.argv) < 2: + usage() + sys.exit(1) + + command = sys.argv[1] + if command == "split": + split_email(sys.argv[2:]) + elif command == "apply": + apply(sys.argv[2:]) + elif command == "commit": + commit(sys.argv[2:]) + elif command == "rev": + rev(sys.argv[2:]) + elif command == "merge": + merge(sys.argv[2:]) + else: + usage() + +main() Property changes on: branches/stable/1_0/scripts/selinux-maint ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-05-03 16:57:04
|
Revision: 2424 http://svn.sourceforge.net/selinux/?rev=2424&view=rev Author: ssmalley Date: 2007-05-03 09:57:02 -0700 (Thu, 03 May 2007) Log Message: ----------- applied r2421:2422 from trunk Modified Paths: -------------- branches/stable/1_0/checkpolicy/Makefile branches/stable/1_0/libselinux/include/Makefile branches/stable/1_0/libselinux/src/Makefile branches/stable/1_0/libselinux/utils/Makefile branches/stable/1_0/libsemanage/include/Makefile branches/stable/1_0/libsemanage/src/Makefile branches/stable/1_0/libsepol/include/Makefile branches/stable/1_0/libsepol/src/Makefile branches/stable/1_0/libsepol/utils/Makefile branches/stable/1_0/policycoreutils/audit2why/Makefile branches/stable/1_0/policycoreutils/load_policy/Makefile branches/stable/1_0/policycoreutils/newrole/Makefile branches/stable/1_0/policycoreutils/restorecon/Makefile branches/stable/1_0/policycoreutils/restorecond/Makefile branches/stable/1_0/policycoreutils/run_init/Makefile branches/stable/1_0/policycoreutils/secon/Makefile branches/stable/1_0/policycoreutils/semodule/Makefile branches/stable/1_0/policycoreutils/semodule_deps/Makefile branches/stable/1_0/policycoreutils/semodule_expand/Makefile branches/stable/1_0/policycoreutils/semodule_link/Makefile branches/stable/1_0/policycoreutils/semodule_package/Makefile branches/stable/1_0/policycoreutils/sestatus/Makefile branches/stable/1_0/policycoreutils/setfiles/Makefile branches/stable/1_0/policycoreutils/setsebool/Makefile Modified: branches/stable/1_0/checkpolicy/Makefile =================================================================== --- branches/stable/1_0/checkpolicy/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/checkpolicy/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -58,4 +58,4 @@ $(MAKE) -C test clean indent: - ../Lindent $(filter-out $(GENERATED),$(wildcard *.[ch])) + ../scripts/Lindent $(filter-out $(GENERATED),$(wildcard *.[ch])) Modified: branches/stable/1_0/libselinux/include/Makefile =================================================================== --- branches/stable/1_0/libselinux/include/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libselinux/include/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -7,5 +7,5 @@ install -m 644 $(wildcard selinux/*.h) $(INCDIR) indent: - ../../Lindent $(wildcard selinux/*.h) + ../../scripts/Lindent $(wildcard selinux/*.h) Modified: branches/stable/1_0/libselinux/src/Makefile =================================================================== --- branches/stable/1_0/libselinux/src/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libselinux/src/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -84,5 +84,5 @@ rm -f $(SWIGCOUT) $(SWIGFILES) indent: - ../../Lindent $(filter-out $(GENERATED),$(wildcard *.[ch])) + ../../scripts/Lindent $(filter-out $(GENERATED),$(wildcard *.[ch])) Modified: branches/stable/1_0/libselinux/utils/Makefile =================================================================== --- branches/stable/1_0/libselinux/utils/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libselinux/utils/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -19,7 +19,7 @@ rm -f $(TARGETS) *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: Modified: branches/stable/1_0/libsemanage/include/Makefile =================================================================== --- branches/stable/1_0/libsemanage/include/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libsemanage/include/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -7,4 +7,4 @@ install -m 644 $(wildcard semanage/*.h) $(INCDIR) indent: - ../../Lindent $(wildcard semanage/*.h) + ../../scripts/Lindent $(wildcard semanage/*.h) Modified: branches/stable/1_0/libsemanage/src/Makefile =================================================================== --- branches/stable/1_0/libsemanage/src/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libsemanage/src/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -99,6 +99,6 @@ rm -f $(SWIGCOUT) $(SWIGFILES) indent: - ../../Lindent $(filter-out $(GENERATED),$(wildcard *.[ch])) + ../../scripts/Lindent $(filter-out $(GENERATED),$(wildcard *.[ch])) .PHONY: all clean pywrap swigify install install-pywrap distclean Modified: branches/stable/1_0/libsepol/include/Makefile =================================================================== --- branches/stable/1_0/libsepol/include/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libsepol/include/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -9,4 +9,4 @@ install -m 644 $(wildcard sepol/policydb/*.h) $(INCDIR)/policydb indent: - ../../Lindent $(wildcard sepol/*.h) + ../../scripts/Lindent $(wildcard sepol/*.h) Modified: branches/stable/1_0/libsepol/src/Makefile =================================================================== --- branches/stable/1_0/libsepol/src/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libsepol/src/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -43,5 +43,5 @@ -rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(TARGET) indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/libsepol/utils/Makefile =================================================================== --- branches/stable/1_0/libsepol/utils/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/libsepol/utils/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -18,7 +18,7 @@ -rm -f $(TARGETS) *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: Modified: branches/stable/1_0/policycoreutils/audit2why/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/audit2why/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/audit2why/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -25,6 +25,6 @@ -rm -f $(TARGETS) *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: Modified: branches/stable/1_0/policycoreutils/load_policy/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/load_policy/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/load_policy/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -22,7 +22,7 @@ -rm -f $(TARGETS) *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: /sbin/restorecon $(SBINDIR)/load_policy Modified: branches/stable/1_0/policycoreutils/newrole/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/newrole/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/newrole/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -76,7 +76,7 @@ rm -f $(TARGETS) *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: install /sbin/restorecon $(BINDIR)/newrole Modified: branches/stable/1_0/policycoreutils/restorecon/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/restorecon/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/restorecon/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -22,7 +22,7 @@ -rm -f restorecon *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: install /sbin/restorecon $(SBINDIR)/restorecon Modified: branches/stable/1_0/policycoreutils/restorecond/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/restorecond/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/restorecond/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -31,5 +31,5 @@ -rm -f restorecond *.o *~ indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/policycoreutils/run_init/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/run_init/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/run_init/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -46,7 +46,7 @@ -rm -f $(TARGETS) *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: install /sbin/restorecon $(SBINDIR)/run_init $(SBINDIR)/open_init_pty Modified: branches/stable/1_0/policycoreutils/secon/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/secon/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/secon/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -30,7 +30,7 @@ rm -f *.o core* secon *~ *.bak indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) bare: clean Modified: branches/stable/1_0/policycoreutils/semodule/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/semodule/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/semodule/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -26,5 +26,5 @@ -rm -f semodule *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/policycoreutils/semodule_deps/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/semodule_deps/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/semodule_deps/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -25,5 +25,5 @@ -rm -f semodule_deps *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/policycoreutils/semodule_expand/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/semodule_expand/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/semodule_expand/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -25,5 +25,5 @@ -rm -f semodule_expand *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/policycoreutils/semodule_link/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/semodule_link/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/semodule_link/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -25,5 +25,5 @@ -rm -f semodule_link *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/policycoreutils/semodule_package/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/semodule_package/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/semodule_package/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -25,5 +25,5 @@ -rm -f semodule_package *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) Modified: branches/stable/1_0/policycoreutils/sestatus/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/sestatus/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/sestatus/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -25,6 +25,6 @@ rm -f sestatus *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: Modified: branches/stable/1_0/policycoreutils/setfiles/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/setfiles/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/setfiles/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -29,7 +29,7 @@ rm -f setfiles *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) relabel: install /sbin/restorecon $(SBINDIR)/setfiles Modified: branches/stable/1_0/policycoreutils/setsebool/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/setsebool/Makefile 2007-05-03 16:54:37 UTC (rev 2423) +++ branches/stable/1_0/policycoreutils/setsebool/Makefile 2007-05-03 16:57:02 UTC (rev 2424) @@ -26,5 +26,5 @@ -rm -f setsebool *.o indent: - ../../Lindent $(wildcard *.[ch]) + ../../scripts/Lindent $(wildcard *.[ch]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-09-24 16:35:11
|
Revision: 2581 http://selinux.svn.sourceforge.net/selinux/?rev=2581&view=rev Author: ssmalley Date: 2007-09-24 09:35:08 -0700 (Mon, 24 Sep 2007) Log Message: ----------- Pass CFLAGS to CC always, even on link command line. Modified Paths: -------------- branches/stable/1_0/libsemanage/src/Makefile branches/stable/1_0/libsepol/src/Makefile Modified: branches/stable/1_0/libsemanage/src/Makefile =================================================================== --- branches/stable/1_0/libsemanage/src/Makefile 2007-09-24 16:33:53 UTC (rev 2580) +++ branches/stable/1_0/libsemanage/src/Makefile 2007-09-24 16:35:08 UTC (rev 2581) @@ -47,14 +47,14 @@ $(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $< $(SWIGSO): $(SWIGLOBJ) - $(CC) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -l$(PYLIBVER) -L$(LIBDIR) -Wl,-soname,$@,-z,defs + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -l$(PYLIBVER) -L$(LIBDIR) -Wl,-soname,$@,-z,defs $(LIBA): $(OBJS) $(AR) rcs $@ $^ ranlib $@ $(LIBSO): $(LOBJS) - $(CC) $(LDFLAGS) -shared -o $@ $^ -lsepol -lselinux -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -lselinux -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs ln -sf $@ $(TARGET) conf-scan.c: conf-scan.l conf-parse.h Modified: branches/stable/1_0/libsepol/src/Makefile =================================================================== --- branches/stable/1_0/libsepol/src/Makefile 2007-09-24 16:33:53 UTC (rev 2580) +++ branches/stable/1_0/libsepol/src/Makefile 2007-09-24 16:35:08 UTC (rev 2581) @@ -20,7 +20,7 @@ ranlib $@ $(LIBSO): $(LOBJS) - $(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,$(LIBSO),--version-script=libsepol.map,-z,defs + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,$(LIBSO),--version-script=libsepol.map,-z,defs ln -sf $@ $(TARGET) %.o: %.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-09-27 13:10:14
|
Revision: 2588 http://selinux.svn.sourceforge.net/selinux/?rev=2588&view=rev Author: ssmalley Date: 2007-09-27 06:10:10 -0700 (Thu, 27 Sep 2007) Log Message: ----------- applied r2517:2518 (disable dontaudit support) from trunk Modified Paths: -------------- branches/stable/1_0/libsemanage/include/semanage/handle.h branches/stable/1_0/libsemanage/src/handle.c branches/stable/1_0/libsemanage/src/libsemanage.map branches/stable/1_0/libsepol/include/sepol/handle.h branches/stable/1_0/libsepol/src/expand.c branches/stable/1_0/libsepol/src/handle.c branches/stable/1_0/libsepol/src/handle.h branches/stable/1_0/libsepol/src/libsepol.map branches/stable/1_0/policycoreutils/semodule/semodule.c Modified: branches/stable/1_0/libsemanage/include/semanage/handle.h =================================================================== --- branches/stable/1_0/libsemanage/include/semanage/handle.h 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsemanage/include/semanage/handle.h 2007-09-27 13:10:10 UTC (rev 2588) @@ -69,6 +69,9 @@ * 1 for yes, 0 for no (default) */ void semanage_set_create_store(semanage_handle_t * handle, int create_store); +/* Set whether or not to disable dontaudits upon commit */ +void semanage_set_disable_dontaudit(semanage_handle_t * handle, int disable_dontaudit); + /* Check whether policy is managed via libsemanage on this system. * Must be called prior to trying to connect. * Return 1 if policy is managed via libsemanage on this system, Modified: branches/stable/1_0/libsemanage/src/handle.c =================================================================== --- branches/stable/1_0/libsemanage/src/handle.c 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsemanage/src/handle.c 2007-09-27 13:10:10 UTC (rev 2588) @@ -109,6 +109,14 @@ return; } +void semanage_set_disable_dontaudit(semanage_handle_t * sh, int disable_dontaudit) +{ + assert(sh != NULL); + + sepol_set_disable_dontaudit(sh->sepolh, disable_dontaudit); + return; +} + int semanage_is_connected(semanage_handle_t * sh) { assert(sh != NULL); Modified: branches/stable/1_0/libsemanage/src/libsemanage.map =================================================================== --- branches/stable/1_0/libsemanage/src/libsemanage.map 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsemanage/src/libsemanage.map 2007-09-27 13:10:10 UTC (rev 2588) @@ -13,6 +13,6 @@ semanage_iface_*; semanage_port_*; semanage_context_*; semanage_node_*; semanage_fcontext_*; semanage_access_check; semanage_set_create_store; - semanage_is_connected; + semanage_is_connected; semanage_set_disable_dontaudit; local: *; }; Modified: branches/stable/1_0/libsepol/include/sepol/handle.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/handle.h 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsepol/include/sepol/handle.h 2007-09-27 13:10:10 UTC (rev 2588) @@ -7,6 +7,10 @@ /* Create and return a sepol handle. */ sepol_handle_t *sepol_handle_create(void); +/* Set whether or not to disable dontaudits, 0 is default and does + * not disable dontaudits, 1 disables them */ +void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit); + /* Destroy a sepol handle. */ void sepol_handle_destroy(sepol_handle_t *); Modified: branches/stable/1_0/libsepol/src/expand.c =================================================================== --- branches/stable/1_0/libsepol/src/expand.c 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsepol/src/expand.c 2007-09-27 13:10:10 UTC (rev 2588) @@ -1366,6 +1366,8 @@ } else if (specified & AVRULE_AUDITDENY) { spec = AVTAB_AUDITDENY; } else if (specified & AVRULE_DONTAUDIT) { + if (handle->disable_dontaudit) + return EXPAND_RULE_SUCCESS; spec = AVTAB_AUDITDENY; } else if (specified & AVRULE_NEVERALLOW) { spec = AVTAB_NEVERALLOW; Modified: branches/stable/1_0/libsepol/src/handle.c =================================================================== --- branches/stable/1_0/libsepol/src/handle.c 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsepol/src/handle.c 2007-09-27 13:10:10 UTC (rev 2588) @@ -1,4 +1,5 @@ #include <stdlib.h> +#include <assert.h> #include "handle.h" #include "debug.h" @@ -13,9 +14,18 @@ sh->msg_callback = sepol_msg_default_handler; sh->msg_callback_arg = NULL; + /* by default do not disable dontaudits */ + sh->disable_dontaudit = 0; + return sh; } +void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit) +{ + assert(sh !=NULL); + sh->disable_dontaudit = disable_dontaudit; +} + void sepol_handle_destroy(sepol_handle_t * sh) { free(sh); Modified: branches/stable/1_0/libsepol/src/handle.h =================================================================== --- branches/stable/1_0/libsepol/src/handle.h 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsepol/src/handle.h 2007-09-27 13:10:10 UTC (rev 2588) @@ -14,6 +14,9 @@ void (*msg_callback) (void *varg, sepol_handle_t * handle, const char *fmt, ...); void *msg_callback_arg; + + int disable_dontaudit; + }; #endif Modified: branches/stable/1_0/libsepol/src/libsepol.map =================================================================== --- branches/stable/1_0/libsepol/src/libsepol.map 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/libsepol/src/libsepol.map 2007-09-27 13:10:10 UTC (rev 2588) @@ -12,5 +12,6 @@ sepol_policydb_*; sepol_set_policydb_from_file; sepol_policy_kern_*; sepol_policy_file_*; + sepol_set_disable_dontaudit; local: *; }; Modified: branches/stable/1_0/policycoreutils/semodule/semodule.c =================================================================== --- branches/stable/1_0/policycoreutils/semodule/semodule.c 2007-09-25 12:15:19 UTC (rev 2587) +++ branches/stable/1_0/policycoreutils/semodule/semodule.c 2007-09-27 13:10:10 UTC (rev 2588) @@ -44,6 +44,7 @@ static int no_reload; static int create_store; static int build; +static int disable_dontaudit; static semanage_handle_t *sh = NULL; static char *store; @@ -131,6 +132,7 @@ printf(" -n,--noreload do not reload policy after commit\n"); printf(" -h,--help print this message and quit\n"); printf(" -v,--verbose be verbose\n"); + printf(" -D,--disable_dontaudit Remove dontaudits from policy\n"); } /* Sets the global mode variable to new_mode, but only if no other @@ -173,6 +175,7 @@ {"reload", 0, NULL, 'R'}, {"noreload", 0, NULL, 'n'}, {"build", 0, NULL, 'B'}, + {"disable_dontaudit", 0, NULL, 'D'}, {NULL, 0, NULL, 0} }; int i; @@ -181,7 +184,7 @@ no_reload = 0; create_store = 0; while ((i = - getopt_long(argc, argv, "s:b:hi:lvqr:u:RnB", opts, + getopt_long(argc, argv, "s:b:hi:lvqr:u:RnBD", opts, NULL)) != -1) { switch (i) { case 'b': @@ -218,6 +221,9 @@ case 'B': build = 1; break; + case 'D': + disable_dontaudit = 1; + break; case '?': default:{ usage(argv[0]); @@ -441,6 +447,8 @@ semanage_set_reload(sh, 0); if (build) semanage_set_rebuild(sh, 1); + if (disable_dontaudit) + semanage_set_disable_dontaudit(sh, 1); result = semanage_commit(sh); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-09-27 13:16:59
|
Revision: 2592 http://selinux.svn.sourceforge.net/selinux/?rev=2592&view=rev Author: ssmalley Date: 2007-09-27 06:15:25 -0700 (Thu, 27 Sep 2007) Log Message: ----------- applied r2565:2567 (handle_unknown support) from trunk Modified Paths: -------------- branches/stable/1_0/checkpolicy/checkmodule.c branches/stable/1_0/checkpolicy/checkpolicy.c branches/stable/1_0/checkpolicy/policy_parse.y branches/stable/1_0/checkpolicy/test/dismod.c branches/stable/1_0/checkpolicy/test/dispol.c branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h branches/stable/1_0/libsepol/src/expand.c branches/stable/1_0/libsepol/src/policydb.c branches/stable/1_0/libsepol/src/write.c Modified: branches/stable/1_0/checkpolicy/checkmodule.c =================================================================== --- branches/stable/1_0/checkpolicy/checkmodule.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/checkpolicy/checkmodule.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -39,6 +39,7 @@ static sidtab_t sidtab; extern int mlspol; +extern int handle_unknown; static char *txtfile = "policy.conf"; static char *binfile = "policy"; @@ -121,6 +122,7 @@ p->policy_type = policy_type; p->policyvers = policyvers; + p->handle_unknown = handle_unknown; pf.type = PF_USE_STDIO; pf.fp = outfp; @@ -135,13 +137,17 @@ static void usage(char *progname) { - printf("usage: %s [-V] [-b] [-m] [-M] [-o FILE] [INPUT]\n", progname); + printf("usage: %s [-V] [-b] [-U handle_unknown] [-m] [-M] [-o FILE] [INPUT]\n", progname); printf("Build base and policy modules.\n"); printf("Options:\n"); printf(" INPUT build module from INPUT (else read from \"%s\")\n", txtfile); printf(" -V show policy versions created by this program\n"); printf(" -b treat input as a binary policy file\n"); + printf(" -U OPTION How to handle unknown classes and permissions\n"); + printf(" deny: Deny unknown kernel checks\n"); + printf(" reject: Reject loading of policy with unknowns\n"); + printf(" allow: Allow unknown kernel checks\n"); printf(" -m build a policy module instead of a base module\n"); printf(" -M enable MLS policy\n"); printf(" -o FILE write module to FILE (else just check syntax)\n"); @@ -156,7 +162,7 @@ int show_version = 0; policydb_t modpolicydb; - while ((ch = getopt(argc, argv, "ho:dbVmM")) != EOF) { + while ((ch = getopt(argc, argv, "ho:dbVU:mM")) != EOF) { switch (ch) { case 'h': usage(argv[0]); @@ -171,6 +177,20 @@ case 'V': show_version = 1; break; + case 'U': + if (!strcasecmp(optarg, "deny")) { + handle_unknown = DENY_UNKNOWN; + break; + } + if (!strcasecmp(optarg, "reject")) { + handle_unknown = REJECT_UNKNOWN; + break; + } + if (!strcasecmp(optarg, "allow")) { + handle_unknown = ALLOW_UNKNOWN; + break; + } + usage(argv[0]); case 'm': policy_type = POLICY_MOD; policyvers = MOD_POLICYDB_VERSION_MAX; @@ -189,6 +209,12 @@ exit(0); } + if (handle_unknown && (policy_type != POLICY_BASE)) { + printf("Handling of unknown classes and permissions is only "); + printf("valid in the base module\n"); + exit(1); + } + if (optind != argc) { file = argv[optind++]; if (optind != argc) @@ -214,6 +240,7 @@ modpolicydb.policy_type = policy_type; modpolicydb.mls = mlspol; + modpolicydb.handle_unknown = handle_unknown; if (read_source_policy(&modpolicydb, file, argv[0]) == -1) { exit(1); Modified: branches/stable/1_0/checkpolicy/checkpolicy.c =================================================================== --- branches/stable/1_0/checkpolicy/checkpolicy.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/checkpolicy/checkpolicy.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -90,6 +90,7 @@ extern policydb_t *policydbp; extern int mlspol; +extern int handle_unknown; static char *txtfile = "policy.conf"; static char *binfile = "policy"; @@ -99,7 +100,7 @@ void usage(char *progname) { printf - ("usage: %s [-b] [-d] [-M] [-c policyvers (%d-%d)] [-o output_file] [input_file]\n", + ("usage: %s [-b] [-d] [-U handle_unknown (allow,deny,reject) [-M] [-c policyvers (%d-%d)] [-o output_file] [input_file]\n", progname, POLICYDB_VERSION_MIN, POLICYDB_VERSION_MAX); exit(1); } @@ -390,7 +391,7 @@ int show_version = 0; struct policy_file pf; - while ((ch = getopt(argc, argv, "o:dbMVc:")) != EOF) { + while ((ch = getopt(argc, argv, "o:dbU:MVc:")) != EOF) { switch (ch) { case 'o': outfile = optarg; @@ -405,6 +406,20 @@ case 'V': show_version = 1; break; + case 'U': + if (!strcasecmp(optarg, "deny")) { + handle_unknown = DENY_UNKNOWN; + break; + } + if (!strcasecmp(optarg, "allow")) { + handle_unknown = ALLOW_UNKNOWN; + break; + } + if (!strcasecmp(optarg, "reject")) { + handle_unknown = REJECT_UNKNOWN; + break; + } + usage(argv[0]); case 'M': mlspol = 1; break; @@ -515,6 +530,7 @@ /* Let sepol know if we are dealing with MLS support */ parse_policy.mls = mlspol; + parse_policy.handle_unknown = handle_unknown; policydbp = &parse_policy; Modified: branches/stable/1_0/checkpolicy/policy_parse.y =================================================================== --- branches/stable/1_0/checkpolicy/policy_parse.y 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/checkpolicy/policy_parse.y 2007-09-27 13:15:25 UTC (rev 2592) @@ -66,6 +66,7 @@ static unsigned int pass; char *curfile = 0; int mlspol = 0; +int handle_unknown = 0; extern unsigned long policydb_lineno; extern unsigned long source_lineno; Modified: branches/stable/1_0/checkpolicy/test/dismod.c =================================================================== --- branches/stable/1_0/checkpolicy/test/dismod.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/checkpolicy/test/dismod.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -665,6 +665,17 @@ return 0; } +int display_handle_unknown(policydb_t * policydb, FILE * out_fp) +{ + if (policydb->handle_unknown == ALLOW_UNKNOWN) + fprintf(out_fp, "Allow unknown classes and perms\n"); + else if (policydb->handle_unknown == DENY_UNKNOWN) + fprintf(out_fp, "Deny unknown classes and perms\n"); + else if (policydb->handle_unknown == REJECT_UNKNOWN) + fprintf(out_fp, "Reject unknown classes and perms\n"); + return 0; +} + static int read_policy(char *filename, policydb_t * policy) { FILE *in_fp; @@ -771,6 +782,7 @@ printf("a) Display avrule requirements\n"); printf("b) Display avrule declarations\n"); printf("l) Link in a module\n"); + printf("u) Display the unknown handling setting\n"); printf("\n"); printf("f) set output file\n"); printf("m) display menu\n"); @@ -879,6 +891,10 @@ fprintf(out_fp, "avrule block declarations:\n"); display_avblock(6, 0, &policydb, out_fp); break; + case 'u': + case 'U': + display_handle_unknown(&policydb, out_fp); + break; case 'f': printf ("\nFilename for output (<CR> for screen output): "); Modified: branches/stable/1_0/checkpolicy/test/dispol.c =================================================================== --- branches/stable/1_0/checkpolicy/test/dispol.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/checkpolicy/test/dispol.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -273,6 +273,17 @@ return 1; } +int display_handle_unknown(policydb_t * policydb, FILE * out_fp) +{ + if (policydb->handle_unknown == ALLOW_UNKNOWN) + fprintf(out_fp, "Allow unknown classes and permisions\n"); + else if (policydb->handle_unknown == DENY_UNKNOWN) + fprintf(out_fp, "Deny unknown classes and permisions\n"); + else if (policydb->handle_unknown == REJECT_UNKNOWN) + fprintf(out_fp, "Reject unknown classes and permisions\n"); + return 0; +} + int change_bool(char *name, int state, policydb_t * p, FILE * fp) { cond_bool_datum_t *bool; @@ -298,6 +309,7 @@ printf("6) display conditional expressions\n"); printf("7) change a boolean value\n"); printf("\n"); + printf("u) display unknown handling setting\n"); printf("f) set output file\n"); printf("m) display menu\n"); printf("q) quit\n"); @@ -409,6 +421,10 @@ change_bool(name, state, &policydb, out_fp); free(name); break; + case 'u': + case 'U': + display_handle_unknown(&policydb, out_fp); + break; case 'f': printf ("\nFilename for output (<CR> for screen output): "); Modified: branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h 2007-09-27 13:15:25 UTC (rev 2592) @@ -469,6 +469,8 @@ ebitmap_t *attr_type_map; /* not saved in the binary policy */ unsigned policyvers; + + unsigned handle_unknown; } policydb_t; struct sepol_policydb { @@ -599,6 +601,13 @@ #define POLICYDB_CONFIG_MLS 1 +/* the config flags related to unknown classes/perms are bits 2 and 3 */ +#define DENY_UNKNOWN 0x00000000 +#define REJECT_UNKNOWN 0x00000002 +#define ALLOW_UNKNOWN 0x00000004 + +#define POLICYDB_CONFIG_UNKNOWN_MASK (DENY_UNKNOWN | REJECT_UNKNOWN | ALLOW_UNKNOWN) + #define OBJECT_R "object_r" #define OBJECT_R_VAL 1 Modified: branches/stable/1_0/libsepol/src/expand.c =================================================================== --- branches/stable/1_0/libsepol/src/expand.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/libsepol/src/expand.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -2249,6 +2249,7 @@ /* Copy mls state from base to out */ out->mls = base->mls; + out->handle_unknown = base->handle_unknown; if ((state.typemap = (uint32_t *) calloc(state.base->p_types.nprim, Modified: branches/stable/1_0/libsepol/src/policydb.c =================================================================== --- branches/stable/1_0/libsepol/src/policydb.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/libsepol/src/policydb.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -3077,6 +3077,8 @@ p->mls = 0; } + p->handle_unknown = buf[bufindex] & POLICYDB_CONFIG_UNKNOWN_MASK; + bufindex++; info = policydb_lookup_compat(r_policyvers, policy_type); Modified: branches/stable/1_0/libsepol/src/write.c =================================================================== --- branches/stable/1_0/libsepol/src/write.c 2007-09-27 13:12:37 UTC (rev 2591) +++ branches/stable/1_0/libsepol/src/write.c 2007-09-27 13:15:25 UTC (rev 2592) @@ -1534,6 +1534,8 @@ if (p->mls) config |= POLICYDB_CONFIG_MLS; + config |= (POLICYDB_CONFIG_UNKNOWN_MASK & p->handle_unknown); + /* Write the magic number and string identifiers. */ items = 0; if (p->policy_type == POLICY_KERN) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-09-27 13:22:57
|
Revision: 2595 http://selinux.svn.sourceforge.net/selinux/?rev=2595&view=rev Author: ssmalley Date: 2007-09-27 06:21:25 -0700 (Thu, 27 Sep 2007) Log Message: ----------- applied 2570 and 2573 (improve error reporting) from trunk Modified Paths: -------------- branches/stable/1_0/libsemanage/src/debug.c branches/stable/1_0/libsemanage/src/direct_api.c branches/stable/1_0/libsemanage/src/semanage_store.c branches/stable/1_0/policycoreutils/semodule/semodule.c Modified: branches/stable/1_0/libsemanage/src/debug.c =================================================================== --- branches/stable/1_0/libsemanage/src/debug.c 2007-09-27 13:16:53 UTC (rev 2594) +++ branches/stable/1_0/libsemanage/src/debug.c 2007-09-27 13:21:25 UTC (rev 2595) @@ -23,6 +23,8 @@ #include <stdarg.h> #include <stdlib.h> #include <stdio.h> +#include <errno.h> +#include <string.h> #include "handle.h" #include "debug.h" @@ -55,10 +57,12 @@ { FILE *stream = NULL; + int errsv = 0; switch (semanage_msg_get_level(handle)) { case SEMANAGE_MSG_ERR: + errsv = errno; case SEMANAGE_MSG_WARN: stream = stderr; break; @@ -77,6 +81,9 @@ vfprintf(stream, fmt, ap); va_end(ap); + if (errsv) + fprintf(stream, " %s.", strerror(errsv)); + fprintf(stream, "\n"); varg = NULL; Modified: branches/stable/1_0/libsemanage/src/direct_api.c =================================================================== --- branches/stable/1_0/libsemanage/src/direct_api.c 2007-09-27 13:16:53 UTC (rev 2594) +++ branches/stable/1_0/libsemanage/src/direct_api.c 2007-09-27 13:21:25 UTC (rev 2595) @@ -32,6 +32,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <limits.h> +#include <errno.h> #include "user_internal.h" #include "seuser_internal.h" @@ -540,6 +541,7 @@ * checking is done because this is likely to fail because * the file does not exist - which is not an error. */ unlink(linked_filename); + errno = 0; } /* ==================== File-backed ================== */ Modified: branches/stable/1_0/libsemanage/src/semanage_store.c =================================================================== --- branches/stable/1_0/libsemanage/src/semanage_store.c 2007-09-27 13:16:53 UTC (rev 2594) +++ branches/stable/1_0/libsemanage/src/semanage_store.c 2007-09-27 13:21:25 UTC (rev 2595) @@ -432,7 +432,7 @@ * overwrite it. Returns 0 on success, -1 on error. */ static int semanage_copy_file(const char *src, const char *dst, mode_t mode) { - int in, out, retval = 0, amount_read, n; + int in, out, retval = 0, amount_read, n, errsv = errno; char tmp[PATH_MAX]; char buf[4192]; @@ -448,23 +448,32 @@ mode = S_IRUSR | S_IWUSR; if ((out = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, mode)) == -1) { + errsv = errno; close(in); - return -1; + retval = -1; + goto out; } while (retval == 0 && (amount_read = read(in, buf, sizeof(buf))) > 0) { - if (write(out, buf, amount_read) != amount_read) { + if (write(out, buf, amount_read) < 0) { + errsv = errno; retval = -1; } } - if (amount_read < 0) + if (amount_read < 0) { + errsv = errno; retval = -1; + } close(in); - if (close(out) < 0) + if (close(out) < 0) { + errsv = errno; retval = -1; + } if (!retval && rename(tmp, dst) == -1) return -1; +out: + errno = errsv; return retval; } @@ -553,12 +562,14 @@ { const char *sandbox = semanage_path(SEMANAGE_TMP, SEMANAGE_TOPLEVEL); struct stat buf; + int errsv; if (stat(sandbox, &buf) == -1) { if (errno != ENOENT) { ERR(sh, "Error scanning directory %s.", sandbox); return -1; } + errno = 0; } else { /* remove the old sandbox */ if (semanage_remove_directory(sandbox) != 0) { @@ -577,7 +588,9 @@ return 0; cleanup: + errsv = errno; semanage_remove_directory(sandbox); + errno = errsv; return -1; } @@ -968,14 +981,14 @@ if (!strncmp(buf, "HOME_DIR", 8) || !strncmp(buf, "HOME_ROOT", 9) || strstr(buf, "ROLE")) { /* This contains one of the template variables, write it to homedir.template */ - if (write(hd, buf, strlen(buf)) == 0) { + if (write(hd, buf, strlen(buf)) < 0) { ERR(sh, "Write to %s failed.", semanage_path(SEMANAGE_TMP, SEMANAGE_HOMEDIR_TMPL)); goto cleanup; } } else { - if (write(fc, buf, strlen(buf)) == 0) { + if (write(fc, buf, strlen(buf)) < 0) { ERR(sh, "Write to %s failed.", semanage_path(SEMANAGE_TMP, SEMANAGE_FC)); goto cleanup; @@ -1074,6 +1087,7 @@ store_fc_loc); goto cleanup; } + errno = 0; snprintf(store_seusers, PATH_MAX, "%s%s", storepath, running_seusers); if (semanage_copy_file @@ -1083,6 +1097,7 @@ store_seusers); goto cleanup; } + errno = 0; snprintf(store_nc, PATH_MAX, "%s%s", storepath, running_nc); if (semanage_copy_file(active_nc, store_nc, sh->conf->file_mode) == -1 @@ -1090,6 +1105,7 @@ ERR(sh, "Could not copy %s to %s.", active_nc, store_nc); goto cleanup; } + errno = 0; if (!sh->do_reload) goto skip_reload; @@ -1111,8 +1127,10 @@ goto skip_reload; } } else if (errno == ENOENT && - strcmp(really_active_store, storepath) != 0) + strcmp(really_active_store, storepath) != 0) { + errno = 0; goto skip_reload; + } if (semanage_reload_policy(sh)) { goto cleanup; @@ -1212,6 +1230,7 @@ /* note that if an error occurs during the next three * function then the store will be left in an * inconsistent state */ + int errsv = errno; if (rename(active, sandbox) < 0) ERR(sh, "Error while renaming %s back to %s.", active, sandbox); @@ -1220,16 +1239,19 @@ active); else semanage_install_active(sh); + errno = errsv; retval = -1; goto cleanup; } if (!sh->conf->save_previous) { + int errsv = errno; retval = semanage_remove_directory(backup); if (retval < 0) { ERR(sh, "Could not delete previous directory %s.", backup); goto cleanup; } + errno = errsv; } cleanup: @@ -1391,22 +1413,26 @@ * there. */ void semanage_release_trans_lock(semanage_handle_t * sh) { + int errsv = errno; if (sh->u.direct.translock_file_fd >= 0) { flock(sh->u.direct.translock_file_fd, LOCK_UN); close(sh->u.direct.translock_file_fd); sh->u.direct.translock_file_fd = -1; } + errno = errsv; } /* Releases the read lock. Does nothing if there was not one already * there. */ void semanage_release_active_lock(semanage_handle_t * sh) { + int errsv = errno; if (sh->u.direct.activelock_file_fd >= 0) { flock(sh->u.direct.activelock_file_fd, LOCK_UN); close(sh->u.direct.activelock_file_fd); sh->u.direct.activelock_file_fd = -1; } + errno = errsv; } /* Read the current commit number from the commit number file which @@ -1432,6 +1458,7 @@ if (errno == ENOENT) { /* the commit number file does not exist yet, * so assume that the number is 0 */ + errno = 0; return 0; } else { ERR(sh, "Could not open commit number file %s.", Modified: branches/stable/1_0/policycoreutils/semodule/semodule.c =================================================================== --- branches/stable/1_0/policycoreutils/semodule/semodule.c 2007-09-27 13:16:53 UTC (rev 2594) +++ branches/stable/1_0/policycoreutils/semodule/semodule.c 2007-09-27 13:21:25 UTC (rev 2595) @@ -329,8 +329,8 @@ if (build) { if ((result = semanage_begin_transaction(sh)) < 0) { - fprintf(stderr, "%s: Could not begin transaction\n", - argv[0]); + fprintf(stderr, "%s: Could not begin transaction: %s\n", + argv[0], errno ? strerror(errno) : ""); goto cleanup; } } @@ -343,8 +343,8 @@ if (mode == INSTALL_M || mode == UPGRADE_M || mode == BASE_M) { if ((data_len = map_file(mode_arg, &data)) == 0) { fprintf(stderr, - "%s: Could not read file '%s':\n", - argv[0], mode_arg); + "%s: Could not read file '%s': %s\n", + argv[0], mode_arg, errno ? strerror(errno) : ""); goto cleanup; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-09-27 13:38:33
|
Revision: 2598 http://selinux.svn.sourceforge.net/selinux/?rev=2598&view=rev Author: ssmalley Date: 2007-09-27 06:37:46 -0700 (Thu, 27 Sep 2007) Log Message: ----------- applied refactored libselinux swig bindings from trunk Modified Paths: -------------- branches/stable/1_0/libselinux/src/Makefile branches/stable/1_0/libselinux/src/fsetfilecon.c branches/stable/1_0/libselinux/src/selinux.py branches/stable/1_0/libselinux/src/selinuxswig.i branches/stable/1_0/libselinux/src/selinuxswig_wrap.c branches/stable/1_0/libsemanage/src/semanage.py branches/stable/1_0/libsemanage/src/semanageswig_wrap.c Added Paths: ----------- branches/stable/1_0/libselinux/src/selinuxswig_python.i Modified: branches/stable/1_0/libselinux/src/Makefile =================================================================== --- branches/stable/1_0/libselinux/src/Makefile 2007-09-27 13:22:54 UTC (rev 2597) +++ branches/stable/1_0/libselinux/src/Makefile 2007-09-27 13:37:46 UTC (rev 2598) @@ -12,7 +12,7 @@ LIBA=libselinux.a TARGET=libselinux.so -SWIGIF= selinuxswig.i +SWIGIF= selinuxswig_python.i SWIGCOUT= selinuxswig_wrap.c SWIGLOBJ:= $(patsubst %.c,%.lo,$(SWIGCOUT)) SWIGSO=_selinux.so Modified: branches/stable/1_0/libselinux/src/fsetfilecon.c =================================================================== --- branches/stable/1_0/libselinux/src/fsetfilecon.c 2007-09-27 13:22:54 UTC (rev 2597) +++ branches/stable/1_0/libselinux/src/fsetfilecon.c 2007-09-27 13:37:46 UTC (rev 2598) @@ -13,7 +13,7 @@ 0); } -hidden_def(setfilecon_raw) +hidden_def(fsetfilecon_raw) int fsetfilecon(int fd, security_context_t context) { Modified: branches/stable/1_0/libselinux/src/selinux.py =================================================================== --- branches/stable/1_0/libselinux/src/selinux.py 2007-09-27 13:22:54 UTC (rev 2597) +++ branches/stable/1_0/libselinux/src/selinux.py 2007-09-27 13:37:46 UTC (rev 2598) @@ -51,45 +51,141 @@ is_selinux_enabled = _selinux.is_selinux_enabled is_selinux_mls_enabled = _selinux.is_selinux_mls_enabled getcon = _selinux.getcon +getcon_raw = _selinux.getcon_raw setcon = _selinux.setcon +setcon_raw = _selinux.setcon_raw getpidcon = _selinux.getpidcon +getpidcon_raw = _selinux.getpidcon_raw getprevcon = _selinux.getprevcon +getprevcon_raw = _selinux.getprevcon_raw getexeccon = _selinux.getexeccon +getexeccon_raw = _selinux.getexeccon_raw setexeccon = _selinux.setexeccon +setexeccon_raw = _selinux.setexeccon_raw getfscreatecon = _selinux.getfscreatecon +getfscreatecon_raw = _selinux.getfscreatecon_raw setfscreatecon = _selinux.setfscreatecon +setfscreatecon_raw = _selinux.setfscreatecon_raw getkeycreatecon = _selinux.getkeycreatecon +getkeycreatecon_raw = _selinux.getkeycreatecon_raw setkeycreatecon = _selinux.setkeycreatecon +setkeycreatecon_raw = _selinux.setkeycreatecon_raw getsockcreatecon = _selinux.getsockcreatecon +getsockcreatecon_raw = _selinux.getsockcreatecon_raw setsockcreatecon = _selinux.setsockcreatecon +setsockcreatecon_raw = _selinux.setsockcreatecon_raw getfilecon = _selinux.getfilecon +getfilecon_raw = _selinux.getfilecon_raw lgetfilecon = _selinux.lgetfilecon +lgetfilecon_raw = _selinux.lgetfilecon_raw fgetfilecon = _selinux.fgetfilecon +fgetfilecon_raw = _selinux.fgetfilecon_raw setfilecon = _selinux.setfilecon +setfilecon_raw = _selinux.setfilecon_raw lsetfilecon = _selinux.lsetfilecon +lsetfilecon_raw = _selinux.lsetfilecon_raw fsetfilecon = _selinux.fsetfilecon +fsetfilecon_raw = _selinux.fsetfilecon_raw getpeercon = _selinux.getpeercon +getpeercon_raw = _selinux.getpeercon_raw +class av_decision(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, av_decision, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, av_decision, name) + __repr__ = _swig_repr + __swig_setmethods__["allowed"] = _selinux.av_decision_allowed_set + __swig_getmethods__["allowed"] = _selinux.av_decision_allowed_get + if _newclass:allowed = _swig_property(_selinux.av_decision_allowed_get, _selinux.av_decision_allowed_set) + __swig_setmethods__["decided"] = _selinux.av_decision_decided_set + __swig_getmethods__["decided"] = _selinux.av_decision_decided_get + if _newclass:decided = _swig_property(_selinux.av_decision_decided_get, _selinux.av_decision_decided_set) + __swig_setmethods__["auditallow"] = _selinux.av_decision_auditallow_set + __swig_getmethods__["auditallow"] = _selinux.av_decision_auditallow_get + if _newclass:auditallow = _swig_property(_selinux.av_decision_auditallow_get, _selinux.av_decision_auditallow_set) + __swig_setmethods__["auditdeny"] = _selinux.av_decision_auditdeny_set + __swig_getmethods__["auditdeny"] = _selinux.av_decision_auditdeny_get + if _newclass:auditdeny = _swig_property(_selinux.av_decision_auditdeny_get, _selinux.av_decision_auditdeny_set) + __swig_setmethods__["seqno"] = _selinux.av_decision_seqno_set + __swig_getmethods__["seqno"] = _selinux.av_decision_seqno_get + if _newclass:seqno = _swig_property(_selinux.av_decision_seqno_get, _selinux.av_decision_seqno_set) + def __init__(self, *args): + this = _selinux.new_av_decision(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _selinux.delete_av_decision + __del__ = lambda self : None; +av_decision_swigregister = _selinux.av_decision_swigregister +av_decision_swigregister(av_decision) + +security_compute_av = _selinux.security_compute_av +security_compute_av_raw = _selinux.security_compute_av_raw +security_compute_create = _selinux.security_compute_create +security_compute_create_raw = _selinux.security_compute_create_raw +security_compute_relabel = _selinux.security_compute_relabel +security_compute_relabel_raw = _selinux.security_compute_relabel_raw +security_compute_member = _selinux.security_compute_member +security_compute_member_raw = _selinux.security_compute_member_raw +security_compute_user = _selinux.security_compute_user +security_compute_user_raw = _selinux.security_compute_user_raw +security_load_policy = _selinux.security_load_policy selinux_mkload_policy = _selinux.selinux_mkload_policy selinux_init_load_policy = _selinux.selinux_init_load_policy +class SELboolean(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, SELboolean, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, SELboolean, name) + __repr__ = _swig_repr + __swig_setmethods__["name"] = _selinux.SELboolean_name_set + __swig_getmethods__["name"] = _selinux.SELboolean_name_get + if _newclass:name = _swig_property(_selinux.SELboolean_name_get, _selinux.SELboolean_name_set) + __swig_setmethods__["value"] = _selinux.SELboolean_value_set + __swig_getmethods__["value"] = _selinux.SELboolean_value_get + if _newclass:value = _swig_property(_selinux.SELboolean_value_get, _selinux.SELboolean_value_set) + def __init__(self, *args): + this = _selinux.new_SELboolean(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _selinux.delete_SELboolean + __del__ = lambda self : None; +SELboolean_swigregister = _selinux.SELboolean_swigregister +SELboolean_swigregister(SELboolean) + security_set_boolean_list = _selinux.security_set_boolean_list security_load_booleans = _selinux.security_load_booleans security_check_context = _selinux.security_check_context +security_check_context_raw = _selinux.security_check_context_raw security_canonicalize_context = _selinux.security_canonicalize_context +security_canonicalize_context_raw = _selinux.security_canonicalize_context_raw security_getenforce = _selinux.security_getenforce security_setenforce = _selinux.security_setenforce +security_disable = _selinux.security_disable security_policyvers = _selinux.security_policyvers security_get_boolean_names = _selinux.security_get_boolean_names security_get_boolean_pending = _selinux.security_get_boolean_pending security_get_boolean_active = _selinux.security_get_boolean_active security_set_boolean = _selinux.security_set_boolean security_commit_booleans = _selinux.security_commit_booleans +string_to_security_class = _selinux.string_to_security_class +string_to_av_perm = _selinux.string_to_av_perm +print_access_vector = _selinux.print_access_vector MATCHPATHCON_BASEONLY = _selinux.MATCHPATHCON_BASEONLY MATCHPATHCON_NOTRANS = _selinux.MATCHPATHCON_NOTRANS +MATCHPATHCON_VALIDATE = _selinux.MATCHPATHCON_VALIDATE set_matchpathcon_flags = _selinux.set_matchpathcon_flags matchpathcon_init = _selinux.matchpathcon_init +matchpathcon_init_prefix = _selinux.matchpathcon_init_prefix +matchpathcon_fini = _selinux.matchpathcon_fini matchpathcon = _selinux.matchpathcon +matchpathcon_index = _selinux.matchpathcon_index +matchpathcon_filespec_add = _selinux.matchpathcon_filespec_add +matchpathcon_filespec_destroy = _selinux.matchpathcon_filespec_destroy +matchpathcon_filespec_eval = _selinux.matchpathcon_filespec_eval +matchpathcon_checkmatches = _selinux.matchpathcon_checkmatches matchmediacon = _selinux.matchmediacon selinux_getenforcemode = _selinux.selinux_getenforcemode +selinux_getpolicytype = _selinux.selinux_getpolicytype selinux_policy_root = _selinux.selinux_policy_root selinux_binary_policy_path = _selinux.selinux_binary_policy_path selinux_failsafe_context_path = _selinux.selinux_failsafe_context_path @@ -102,6 +198,7 @@ selinux_homedir_context_path = _selinux.selinux_homedir_context_path selinux_media_context_path = _selinux.selinux_media_context_path selinux_contexts_path = _selinux.selinux_contexts_path +selinux_securetty_types_path = _selinux.selinux_securetty_types_path selinux_booleans_path = _selinux.selinux_booleans_path selinux_customizable_types_path = _selinux.selinux_customizable_types_path selinux_users_path = _selinux.selinux_users_path @@ -111,11 +208,26 @@ selinux_path = _selinux.selinux_path selinux_check_passwd_access = _selinux.selinux_check_passwd_access checkPasswdAccess = _selinux.checkPasswdAccess +selinux_check_securetty_context = _selinux.selinux_check_securetty_context +set_selinuxmnt = _selinux.set_selinuxmnt rpm_execcon = _selinux.rpm_execcon is_context_customizable = _selinux.is_context_customizable selinux_trans_to_raw_context = _selinux.selinux_trans_to_raw_context selinux_raw_to_trans_context = _selinux.selinux_raw_to_trans_context -selinux_getpolicytype = _selinux.selinux_getpolicytype getseuserbyname = _selinux.getseuserbyname +selinux_file_context_cmp = _selinux.selinux_file_context_cmp +selinux_file_context_verify = _selinux.selinux_file_context_verify +selinux_lsetfilecon_default = _selinux.selinux_lsetfilecon_default +selinux_default_type_path = _selinux.selinux_default_type_path +get_default_type = _selinux.get_default_type +SELINUX_DEFAULTUSER = _selinux.SELINUX_DEFAULTUSER +get_ordered_context_list = _selinux.get_ordered_context_list +get_ordered_context_list_with_level = _selinux.get_ordered_context_list_with_level +get_default_context = _selinux.get_default_context +get_default_context_with_level = _selinux.get_default_context_with_level +get_default_context_with_role = _selinux.get_default_context_with_role +get_default_context_with_rolelevel = _selinux.get_default_context_with_rolelevel +query_user_context = _selinux.query_user_context +manual_user_enter_context = _selinux.manual_user_enter_context Modified: branches/stable/1_0/libselinux/src/selinuxswig.i =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig.i 2007-09-27 13:22:54 UTC (rev 2597) +++ branches/stable/1_0/libselinux/src/selinuxswig.i 2007-09-27 13:37:46 UTC (rev 2598) @@ -1,7 +1,9 @@ -/* Author: Dan Walsh +/* Authors: Dan Walsh + * James Athey * * Copyright (C) 2004-2005 Red Hat - * + * Copyright (C) 2007 Tresys Technology, LLC + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -17,150 +19,47 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - %module selinux %{ #include "selinux/selinux.h" %} -%apply int *OUTPUT { int * }; +%apply int *OUTPUT { int *enforce }; %apply int *OUTPUT { size_t * }; -%typemap(in, numinputs=0) security_context_t *(security_context_t temp=NULL) { - $1 = &temp; -} -%typemap(argout) security_context_t * (char *temp=NULL) { - if (*$1) - temp = *$1; - else - temp = ""; - $result = SWIG_Python_AppendOutput($result, PyString_FromString(temp)); -} +%typedef unsigned mode_t; -%typemap(in) security_context_t { - $1 = (security_context_t)PyString_AsString($input); +%typemap(in, numinputs=0) (char ***names, int *len) (char **temp1, int temp2) { + $1 = &temp1; + $2 = &temp2; } -%typedef unsigned mode_t; - -extern int is_selinux_enabled(void); -extern int is_selinux_mls_enabled(void); -extern int getcon(security_context_t *con); -extern int setcon(security_context_t con); -extern int getpidcon(int pid, security_context_t *con); -extern int getprevcon(security_context_t *con); -extern int getexeccon(security_context_t *con); -extern int setexeccon(security_context_t con); -extern int getfscreatecon(security_context_t *con); -extern int setfscreatecon(security_context_t context); -extern int getkeycreatecon(security_context_t *con); -extern int setkeycreatecon(security_context_t context); -extern int getsockcreatecon(security_context_t *con); -extern int setsockcreatecon(security_context_t context); -extern int getfilecon(const char *path, security_context_t *con); -extern int lgetfilecon(const char *path, security_context_t *con); -extern int fgetfilecon(int fd, security_context_t *con); -extern int setfilecon(const char *path, security_context_t con); -extern int lsetfilecon(const char *path, security_context_t con); -extern int fsetfilecon(int fd, security_context_t con); -extern int getpeercon(int fd, security_context_t *con); -extern int selinux_mkload_policy(int preservebools); -extern int selinux_init_load_policy(int *enforce); -extern int security_set_boolean_list(size_t boolcnt, - SELboolean *boollist, - int permanent); -extern int security_load_booleans(char *path); -extern int security_check_context(security_context_t con); -extern int security_canonicalize_context(security_context_t con, - security_context_t *canoncon); -extern int security_getenforce(void); -extern int security_setenforce(int value); -extern int security_policyvers(void); -extern int security_get_boolean_names(char ***names, int *len); -extern int security_get_boolean_pending(const char *name); -extern int security_get_boolean_active(const char *name); -extern int security_set_boolean(const char *name, int value); -extern int security_commit_booleans(void); - -/* Set flags controlling operation of matchpathcon_init or matchpathcon. */ -#define MATCHPATHCON_BASEONLY 1 /* Only process the base file_contexts file. */ -#define MATCHPATHCON_NOTRANS 2 /* Do not perform any context translation. */ -extern void set_matchpathcon_flags(unsigned int flags); -extern int matchpathcon_init(const char *path); -extern int matchpathcon(const char *path, - mode_t mode, - security_context_t *con); - -extern int matchmediacon(const char *media, - security_context_t *con); - -extern int selinux_getenforcemode(int *enforce); -extern const char *selinux_policy_root(void); -extern const char *selinux_binary_policy_path(void); -extern const char *selinux_failsafe_context_path(void); -extern const char *selinux_removable_context_path(void); -extern const char *selinux_default_context_path(void); -extern const char *selinux_user_contexts_path(void); -extern const char *selinux_file_context_path(void); -extern const char *selinux_file_context_homedir_path(void); -extern const char *selinux_file_context_local_path(void); -extern const char *selinux_homedir_context_path(void); -extern const char *selinux_media_context_path(void); -extern const char *selinux_contexts_path(void); -extern const char *selinux_booleans_path(void); -extern const char *selinux_customizable_types_path(void); -extern const char *selinux_users_path(void); -extern const char *selinux_usersconf_path(void); -extern const char *selinux_translations_path(void); -extern const char *selinux_netfilter_context_path(void); -extern const char *selinux_path(void); -extern int selinux_check_passwd_access(access_vector_t requested); -extern int checkPasswdAccess(access_vector_t requested); - -// This tells SWIG to treat char ** as a special case -%typemap(python,in) char ** { - /* Check if is a list */ - if (PyList_Check($input)) { - int size = PyList_Size($input); - int i = 0; - $1 = (char **) malloc((size+1)*sizeof(char *)); - if ($1 == NULL) { - PyErr_SetString(PyExc_MemoryError,"Out of memory"); - return NULL; - } - for (i = 0; i < size; i++) { - PyObject *o = PyList_GetItem($input,i); - if (PyString_Check(o)) - $1[i] = PyString_AsString(PyList_GetItem($input,i)); - else { - PyErr_SetString(PyExc_TypeError,"list must contain strings"); - free($1); - return NULL; - } - } - $1[i] = 0; - } else { - PyErr_SetString(PyExc_TypeError,"not a list"); - return NULL; - } +%typemap(freearg) (char ***names, int *len) { + int i; + if (*$1) { + for (i = 0; i < *$2; i++) { + free((*$1)[i]); + } + free(*$1); + } } -extern int rpm_execcon(unsigned int verified, - const char *filename, - char **, char **); - -extern int is_context_customizable (security_context_t scontext); - -extern int selinux_trans_to_raw_context(char *trans, - security_context_t *rawp); -extern int selinux_raw_to_trans_context(char *raw, - security_context_t *transp); - -%typemap(in, numinputs=0) char **(char *temp=NULL) { +%typemap(in, numinputs=0) (security_context_t **) (security_context_t *temp) { $1 = &temp; } -%typemap(argout) char ** { - $result = SWIG_Python_AppendOutput($result, PyString_FromString(*$1)); +%typemap(freearg) (security_context_t **) { + if (*$1) freeconary(*$1); } -extern int selinux_getpolicytype(char **enforce); -extern int getseuserbyname(const char *linuxuser, char **seuser, char **level); + +/* Ignore functions that don't make sense when wrapped */ +%ignore freecon; +%ignore freeconary; + +/* Ignore functions that take a function pointer as an argument */ +%ignore set_matchpathcon_printf; +%ignore set_matchpathcon_invalidcon; +%ignore set_matchpathcon_canoncon; + +%include "../include/selinux/selinux.h" +%include "../include/selinux/get_default_type.h" +%include "../include/selinux/get_context_list.h" Copied: branches/stable/1_0/libselinux/src/selinuxswig_python.i (from rev 2489, trunk/libselinux/src/selinuxswig_python.i) =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig_python.i (rev 0) +++ branches/stable/1_0/libselinux/src/selinuxswig_python.i 2007-09-27 13:37:46 UTC (rev 2598) @@ -0,0 +1,138 @@ +/* Author: James Athey + * + * Copyright (C) 2007 Tresys Technology, LLC + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +%module selinux +%{ + #include "selinux/selinux.h" +%} + +/* security_get_boolean_names() typemap */ +%typemap(argout) (char ***names, int *len) { + PyObject* list = PyList_New(*$2); + int i; + for (i = 0; i < *$2; i++) { + PyList_SetItem(list, i, PyString_FromString((*$1)[i])); + } + $result = SWIG_Python_AppendOutput($result, list); +} + +/* Makes security_compute_user() return a Python list of contexts */ +%typemap(argout) (security_context_t **con) { + PyObject* plist; + int i, len = 0; + + if (*$1) { + while((*$1)[len]) + len++; + plist = PyList_New(len); + for (i = 0; i < len; i++) { + PyList_SetItem(plist, i, PyString_FromString((*$1)[i])); + } + } else { + plist = PyList_New(0); + } + + $result = SWIG_Python_AppendOutput($result, plist); +} + +/* Makes functions in get_context_list.h return a Python list of contexts */ +%typemap(argout) (security_context_t **list) { + PyObject* plist; + int i; + + if (*$1) { + plist = PyList_New(result); + for (i = 0; i < result; i++) { + PyList_SetItem(plist, i, PyString_FromString((*$1)[i])); + } + } else { + plist = PyList_New(0); + } + /* Only return the Python list, don't need to return the length anymore */ + $result = plist; +} + +%typemap(in,noblock=1,numinputs=0) security_context_t * (security_context_t temp = 0) { + $1 = &temp; +} +%typemap(freearg,match="in") security_context_t * ""; +%typemap(argout,noblock=1) security_context_t * { + if (*$1) { + %append_output(SWIG_FromCharPtr(*$1)); + freecon(*$1); + } + else { + Py_INCREF(Py_None); + %append_output(Py_None); + } +} + +%typemap(in,noblock=1,numinputs=0) char ** (char * temp = 0) { + $1 = &temp; +} +%typemap(freearg,match="in") char ** ""; +%typemap(argout,noblock=1) char ** { + if (*$1) { + %append_output(SWIG_FromCharPtr(*$1)); + free(*$1); + } + else { + Py_INCREF(Py_None); + %append_output(Py_None); + } +} + +%typemap(in) char * const [] { + int i, size; + PyObject * s; + + if (!PySequence_Check($input)) { + PyErr_SetString(PyExc_ValueError, "Expected a sequence"); + return NULL; + } + + size = PySequence_Size($input); + + $1 = (char**) malloc(size + 1); + + for(i = 0; i < size; i++) { + if (!PyString_Check(PySequence_GetItem($input, i))) { + PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings"); + return NULL; + } + } + + for(i = 0; i < size; i++) { + s = PySequence_GetItem($input, i); + $1[i] = (char*) malloc(PyString_Size(s) + 1); + strcpy($1[i], PyString_AsString(s)); + } + $1[size] = NULL; +} + +%typemap(freearg,match="in") char * const [] { + int i = 0; + while($1[i]) { + free($1[i]); + i++; + } + free($1); +} + +%include "selinuxswig.i" Modified: branches/stable/1_0/libselinux/src/selinuxswig_wrap.c =================================================================== --- branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-09-27 13:22:54 UTC (rev 2597) +++ branches/stable/1_0/libselinux/src/selinuxswig_wrap.c 2007-09-27 13:37:46 UTC (rev 2598) @@ -2449,15 +2449,17 @@ /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_SELboolean swig_types[0] -#define SWIGTYPE_p_access_vector_t swig_types[1] +#define SWIGTYPE_p_av_decision swig_types[1] #define SWIGTYPE_p_char swig_types[2] -#define SWIGTYPE_p_int swig_types[3] -#define SWIGTYPE_p_p_char swig_types[4] -#define SWIGTYPE_p_p_p_char swig_types[5] -#define SWIGTYPE_p_security_context_t swig_types[6] -#define SWIGTYPE_p_unsigned_int swig_types[7] -static swig_type_info *swig_types[9]; -static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0}; +#define SWIGTYPE_p_ino_t swig_types[3] +#define SWIGTYPE_p_int swig_types[4] +#define SWIGTYPE_p_p_char swig_types[5] +#define SWIGTYPE_p_p_p_char swig_types[6] +#define SWIGTYPE_p_pid_t swig_types[7] +#define SWIGTYPE_p_unsigned_int swig_types[8] +#define SWIGTYPE_p_unsigned_short swig_types[9] +static swig_type_info *swig_types[11]; +static swig_module_info swig_module = {swig_types, 10, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -2487,6 +2489,9 @@ #include "selinux/selinux.h" + #include "selinux/selinux.h" + + #define SWIG_From_long PyInt_FromLong @@ -2497,6 +2502,74 @@ } +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) +{ + if (PyString_Check(obj)) { + char *cstr; Py_ssize_t len; + PyString_AsStringAndSize(obj, &cstr, &len); + if (cptr) { + if (alloc) { + /* + In python the user should not be able to modify the inner + string representation. To warranty that, if you define + SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string + buffer is always returned. + + The default behavior is just to return the pointer value, + so, be careful. + */ +#if defined(SWIG_PYTHON_SAFE_CSTRINGS) + if (*alloc != SWIG_OLDOBJ) +#else + if (*alloc == SWIG_NEWOBJ) +#endif + { + *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); + *alloc = SWIG_NEWOBJ; + } + else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } else { + *cptr = PyString_AsString(obj); + } + } + if (psize) *psize = len + 1; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + #include <limits.h> #ifndef LLONG_MIN # define LLONG_MIN LONG_LONG_MIN @@ -2644,75 +2717,7 @@ } -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ - if (PyString_Check(obj)) { - char *cstr; Py_ssize_t len; - PyString_AsStringAndSize(obj, &cstr, &len); - if (cptr) { - if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); - *alloc = SWIG_NEWOBJ; - } - else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { - *cptr = PyString_AsString(obj); - } - } - if (psize) *psize = len + 1; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - - -SWIGINTERN int SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) { if (PyInt_Check(obj)) { @@ -2756,32 +2761,63 @@ } -SWIGINTERNINLINE int -SWIG_AsVal_size_t (PyObject * obj, size_t *val) +SWIGINTERN int +SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) { unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = (size_t)(v); + int res = SWIG_AsVal_unsigned_SS_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v > UINT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (unsigned int)(v); + } + } return res; } +SWIGINTERNINLINE PyObject* +SWIG_From_unsigned_SS_long (unsigned long value) +{ + return (value > LONG_MAX) ? + PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value)); +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_unsigned_SS_int (unsigned int value) +{ + return SWIG_From_unsigned_SS_long (value); +} + + SWIGINTERN int -SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) +SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, &v); if (SWIG_IsOK(res)) { - if ((v > UINT_MAX)) { + if ((v > USHRT_MAX)) { return SWIG_OverflowError; } else { - if (val) *val = (unsigned int)(v); + if (val) *val = (unsigned short)(v); } } return res; } +SWIGINTERNINLINE int +SWIG_AsVal_size_t (PyObject * obj, size_t *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); + return res; +} + + SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char* carray, size_t size) { @@ -2805,6 +2841,13 @@ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); } + +SWIGINTERNINLINE PyObject * +SWIG_From_unsigned_SS_short (unsigned short value) +{ + return SWIG_From_unsigned_SS_long (value); +} + #ifdef __cplusplus extern "C" { #endif @@ -2838,75 +2881,172 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 = NULL ; - char *temp10 = NULL ; + security_context_t temp1 = 0 ; - { - arg1 = &temp1; - } + arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getcon")) SWIG_fail; result = (int)getcon(arg1); resultobj = SWIG_From_int((int)(result)); - { - if (*arg1) - temp10 = *arg1; - else - temp10 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp10)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_getcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t *arg1 = (security_context_t *) 0 ; + int result; + security_context_t temp1 = 0 ; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":getcon_raw")) SWIG_fail; + result = (int)getcon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_setcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 ; + security_context_t arg1 = (security_context_t) 0 ; int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:setcon",&obj0)) SWIG_fail; - { - arg1 = (security_context_t)PyString_AsString(obj0); + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon" "', argument " "1"" of type '" "security_context_t""'"); } + arg1 = (security_context_t)(buf1); result = (int)setcon(arg1); resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } +SWIGINTERN PyObject *_wrap_setcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t arg1 = (security_context_t) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:setcon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setcon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); + result = (int)setcon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_getpidcon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - int arg1 ; + pid_t arg1 ; security_context_t *arg2 = (security_context_t *) 0 ; int result; - int val1 ; - int ecode1 = 0 ; - security_context_t temp2 = NULL ; - char *temp20 = NULL ; + void *argp1 ; + int res1 = 0 ; + security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:getpidcon",&obj0)) SWIG_fail; { - arg2 = &temp2; + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_pid_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getpidcon" "', argument " "1"" of type '" "pid_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "getpidcon" "', argument " "1"" of type '" "pid_t""'"); + } else { + arg1 = *((pid_t *)(argp1)); + } } - if (!PyArg_ParseTuple(args,(char *)"O:getpidcon",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "getpidcon" "', argument " "1"" of type '" "int""'"); - } - arg1 = (int)(val1); result = (int)getpidcon(arg1,arg2); resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_getpidcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + pid_t arg1 ; + security_context_t *arg2 = (security_context_t *) 0 ; + int result; + void *argp1 ; + int res1 = 0 ; + security_context_t temp2 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:getpidcon_raw",&obj0)) SWIG_fail; { - if (*arg2) - temp20 = *arg2; - else - temp20 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp20)); + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_pid_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getpidcon_raw" "', argument " "1"" of type '" "pid_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "getpidcon_raw" "', argument " "1"" of type '" "pid_t""'"); + } else { + arg1 = *((pid_t *)(argp1)); + } } + result = (int)getpidcon_raw(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; @@ -2917,204 +3057,442 @@ PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 = NULL ; - char *temp10 = NULL ; + security_context_t temp1 = 0 ; - { - arg1 = &temp1; - } + arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getprevcon")) SWIG_fail; result = (int)getprevcon(arg1); resultobj = SWIG_From_int((int)(result)); - { - if (*arg1) - temp10 = *arg1; - else - temp10 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp10)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_getprevcon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t *arg1 = (security_context_t *) 0 ; + int result; + security_context_t temp1 = 0 ; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":getprevcon_raw")) SWIG_fail; + result = (int)getprevcon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_getexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 = NULL ; - char *temp10 = NULL ; + security_context_t temp1 = 0 ; - { - arg1 = &temp1; - } + arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getexeccon")) SWIG_fail; result = (int)getexeccon(arg1); resultobj = SWIG_From_int((int)(result)); - { - if (*arg1) - temp10 = *arg1; - else - temp10 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp10)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_getexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t *arg1 = (security_context_t *) 0 ; + int result; + security_context_t temp1 = 0 ; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":getexeccon_raw")) SWIG_fail; + result = (int)getexeccon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_setexeccon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 ; + security_context_t arg1 = (security_context_t) 0 ; int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:setexeccon",&obj0)) SWIG_fail; - { - arg1 = (security_context_t)PyString_AsString(obj0); + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon" "', argument " "1"" of type '" "security_context_t""'"); } + arg1 = (security_context_t)(buf1); result = (int)setexeccon(arg1); resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } +SWIGINTERN PyObject *_wrap_setexeccon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t arg1 = (security_context_t) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:setexeccon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setexeccon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); + result = (int)setexeccon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_getfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 = NULL ; - char *temp10 = NULL ; + security_context_t temp1 = 0 ; - { - arg1 = &temp1; - } + arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getfscreatecon")) SWIG_fail; result = (int)getfscreatecon(arg1); resultobj = SWIG_From_int((int)(result)); - { - if (*arg1) - temp10 = *arg1; - else - temp10 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp10)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_getfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t *arg1 = (security_context_t *) 0 ; + int result; + security_context_t temp1 = 0 ; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":getfscreatecon_raw")) SWIG_fail; + result = (int)getfscreatecon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_setfscreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 ; + security_context_t arg1 = (security_context_t) 0 ; int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon",&obj0)) SWIG_fail; - { - arg1 = (security_context_t)PyString_AsString(obj0); + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon" "', argument " "1"" of type '" "security_context_t""'"); } + arg1 = (security_context_t)(buf1); result = (int)setfscreatecon(arg1); resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } +SWIGINTERN PyObject *_wrap_setfscreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t arg1 = (security_context_t) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:setfscreatecon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfscreatecon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); + result = (int)setfscreatecon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_getkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 = NULL ; - char *temp10 = NULL ; + security_context_t temp1 = 0 ; - { - arg1 = &temp1; - } + arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getkeycreatecon")) SWIG_fail; result = (int)getkeycreatecon(arg1); resultobj = SWIG_From_int((int)(result)); - { - if (*arg1) - temp10 = *arg1; - else - temp10 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp10)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_getkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t *arg1 = (security_context_t *) 0 ; + int result; + security_context_t temp1 = 0 ; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":getkeycreatecon_raw")) SWIG_fail; + result = (int)getkeycreatecon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_setkeycreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 ; + security_context_t arg1 = (security_context_t) 0 ; int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon",&obj0)) SWIG_fail; - { - arg1 = (security_context_t)PyString_AsString(obj0); + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon" "', argument " "1"" of type '" "security_context_t""'"); } + arg1 = (security_context_t)(buf1); result = (int)setkeycreatecon(arg1); resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } +SWIGINTERN PyObject *_wrap_setkeycreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t arg1 = (security_context_t) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:setkeycreatecon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setkeycreatecon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); + result = (int)setkeycreatecon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_getsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_context_t *arg1 = (security_context_t *) 0 ; int result; - security_context_t temp1 = NULL ; - char *temp10 = NULL ; + security_context_t temp1 = 0 ; - { - arg1 = &temp1; - } + arg1 = &temp1; if (!PyArg_ParseTuple(args,(char *)":getsockcreatecon")) SWIG_fail; result = (int)getsockcreatecon(arg1); resultobj = SWIG_From_int((int)(result)); - { - if (*arg1) - temp10 = *arg1; - else - temp10 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp10)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_getsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t *arg1 = (security_context_t *) 0 ; + int result; + security_context_t temp1 = 0 ; + + arg1 = &temp1; + if (!PyArg_ParseTuple(args,(char *)":getsockcreatecon_raw")) SWIG_fail; + result = (int)getsockcreatecon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (*arg1) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg1)); + freecon(*arg1); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_setsockcreatecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - security_context_t arg1 ; + security_context_t arg1 = (security_context_t) 0 ; int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon",&obj0)) SWIG_fail; - { - arg1 = (security_context_t)PyString_AsString(obj0); + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon" "', argument " "1"" of type '" "security_context_t""'"); } + arg1 = (security_context_t)(buf1); result = (int)setsockcreatecon(arg1); resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } +SWIGINTERN PyObject *_wrap_setsockcreatecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + security_context_t arg1 = (security_context_t) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:setsockcreatecon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setsockcreatecon_raw" "', argument " "1"" of type '" "security_context_t""'"); + } + arg1 = (security_context_t)(buf1); + result = (int)setsockcreatecon_raw(arg1); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_getfilecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; @@ -3123,13 +3501,10 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 = NULL ; - char *temp20 = NULL ; + security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; - { - arg2 = &temp2; - } + arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:getfilecon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { @@ -3138,13 +3513,14 @@ arg1 = (char *)(buf1); result = (int)getfilecon((char const *)arg1,arg2); resultobj = SWIG_From_int((int)(result)); - { - if (*arg2) - temp20 = *arg2; - else - temp20 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp20)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: @@ -3153,6 +3529,42 @@ } +SWIGINTERN PyObject *_wrap_getfilecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + security_context_t *arg2 = (security_context_t *) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + security_context_t temp2 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:getfilecon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getfilecon_raw" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + result = (int)getfilecon_raw((char const *)arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_lgetfilecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; @@ -3161,13 +3573,10 @@ int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - security_context_t temp2 = NULL ; - char *temp20 = NULL ; + security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; - { - arg2 = &temp2; - } + arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:lgetfilecon",&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { @@ -3176,13 +3585,14 @@ arg1 = (char *)(buf1); result = (int)lgetfilecon((char const *)arg1,arg2); resultobj = SWIG_From_int((int)(result)); - { - if (*arg2) - temp20 = *arg2; - else - temp20 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp20)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: @@ -3191,6 +3601,42 @@ } +SWIGINTERN PyObject *_wrap_lgetfilecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + security_context_t *arg2 = (security_context_t *) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + security_context_t temp2 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:lgetfilecon_raw",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lgetfilecon_raw" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + result = (int)lgetfilecon_raw((char const *)arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + return NULL; +} + + SWIGINTERN PyObject *_wrap_fgetfilecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; int arg1 ; @@ -3198,13 +3644,10 @@ int result; int val1 ; int ecode1 = 0 ; - security_context_t temp2 = NULL ; - char *temp20 = NULL ; + security_context_t temp2 = 0 ; PyObject * obj0 = 0 ; - { - arg2 = &temp2; - } + arg2 = &temp2; if (!PyArg_ParseTuple(args,(char *)"O:fgetfilecon",&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { @@ -3213,27 +3656,64 @@ arg1 = (int)(val1); result = (int)fgetfilecon(arg1,arg2); resultobj = SWIG_From_int((int)(result)); - { - if (*arg2) - temp20 = *arg2; - else - temp20 = ""; - resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromString(temp20)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } return resultobj; fail: return NULL; } +SWIGINTERN PyObject *_wrap_fgetfilecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + security_context_t *arg2 = (security_context_t *) 0 ; + int result; + int val1 ; + int ecode1 = 0 ; + security_context_t temp2 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &temp2; + if (!PyArg_ParseTuple(args,(char *)"O:fgetfilecon_raw",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fgetfilecon_raw" "', argument " "1"" of type '" "int""'"); + } + arg1 = (int)(val1); + result = (int)fgetfilecon_raw(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (*arg2) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(*arg2)); + freecon(*arg2); + } + else { + Py_INCREF(Py_None); + resultobj = SWIG_Python_AppendOutput(resultobj, Py_None); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_setfilecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; - security_context_t arg2 ; + security_context_t arg2 = (security_context_t) 0 ; int result; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -3243,27 +3723,71 @@ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfilecon" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); - { - arg2 = (security_context_t)PyString_AsString(obj1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setfilecon" "', argument " "2"" of type '" "security_context_t""'"); } + arg2 = (security_context_t)(buf2); result = (int)setfilecon((char const *)arg1,arg2); resultobj = SWIG_From_int((int)(result)); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } +SWIGINTERN PyObject *_wrap_setfilecon_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + security_context_t arg2 = (security_context_t) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:setfilecon_raw",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "setfilecon_raw" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = (char *)(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setfilecon_raw" "', argument " "2"" of type '" "security_context_t""'"); + } + arg2 = (security_context_t)(buf2); + result = (int)setfilecon_raw((char const *)arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; +} + + SWIGINTERN PyObject *_wrap_lsetfilecon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObjec... [truncated message content] |
From: <ssm...@us...> - 2007-11-05 19:01:34
|
Revision: 2670 http://selinux.svn.sourceforge.net/selinux/?rev=2670&view=rev Author: ssmalley Date: 2007-11-05 11:01:32 -0800 (Mon, 05 Nov 2007) Log Message: ----------- applied r2666:2667 from trunk Modified Paths: -------------- branches/stable/1_0/libsemanage/src/conf-parse.y branches/stable/1_0/libsemanage/src/conf-scan.l branches/stable/1_0/libsemanage/src/semanage_conf.h branches/stable/1_0/libsemanage/src/semanage_store.c branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h branches/stable/1_0/libsepol/include/sepol/policydb.h branches/stable/1_0/libsepol/src/policydb_public.c Modified: branches/stable/1_0/libsemanage/src/conf-parse.y =================================================================== --- branches/stable/1_0/libsemanage/src/conf-parse.y 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsemanage/src/conf-parse.y 2007-11-05 19:01:32 UTC (rev 2670) @@ -57,7 +57,7 @@ } %token MODULE_STORE VERSION EXPAND_CHECK FILE_MODE SAVE_PREVIOUS SAVE_LINKED -%token LOAD_POLICY_START SETFILES_START GENHOMEDIRCON_START +%token LOAD_POLICY_START SETFILES_START GENHOMEDIRCON_START HANDLE_UNKNOWN %token VERIFY_MOD_START VERIFY_LINKED_START VERIFY_KERNEL_START BLOCK_END %token PROG_PATH PROG_ARGS %token <s> ARG @@ -80,6 +80,7 @@ | file_mode | save_previous | save_linked + | handle_unknown ; module_store: MODULE_STORE '=' ARG { @@ -137,6 +138,18 @@ } ; +handle_unknown: HANDLE_UNKNOWN '=' ARG { + if (strcasecmp($3, "deny") == 0) { + current_conf->handle_unknown = SEPOL_DENY_UNKNOWN; + } else if (strcasecmp($3, "reject") == 0) { + current_conf->handle_unknown = SEPOL_REJECT_UNKNOWN; + } else if (strcasecmp($3, "allow") == 0) { + current_conf->handle_unknown = SEPOL_ALLOW_UNKNOWN; + } else { + yyerror("handle-unknown can only be 'deny', 'reject' or 'allow'"); + } + free($3); + } command_block: command_start external_opts BLOCK_END { @@ -211,6 +224,7 @@ conf->store_path = strdup(basename(selinux_policy_root())); conf->policyvers = sepol_policy_kern_vers_max(); conf->expand_check = 1; + conf->handle_unknown = -1; conf->file_mode = 0644; conf->save_previous = 0; Modified: branches/stable/1_0/libsemanage/src/conf-scan.l =================================================================== --- branches/stable/1_0/libsemanage/src/conf-scan.l 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsemanage/src/conf-scan.l 2007-11-05 19:01:32 UTC (rev 2670) @@ -44,6 +44,7 @@ file-mode return FILE_MODE; save-previous return SAVE_PREVIOUS; save-linked return SAVE_LINKED; +handle-unknown return HANDLE_UNKNOWN; "[load_policy]" return LOAD_POLICY_START; "[setfiles]" return SETFILES_START; "[genhomedircon]" return GENHOMEDIRCON_START; Modified: branches/stable/1_0/libsemanage/src/semanage_conf.h =================================================================== --- branches/stable/1_0/libsemanage/src/semanage_conf.h 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsemanage/src/semanage_conf.h 2007-11-05 19:01:32 UTC (rev 2670) @@ -37,6 +37,7 @@ int expand_check; int save_previous; int save_linked; + int handle_unknown; mode_t file_mode; struct external_prog *load_policy; struct external_prog *setfiles; Modified: branches/stable/1_0/libsemanage/src/semanage_store.c =================================================================== --- branches/stable/1_0/libsemanage/src/semanage_store.c 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsemanage/src/semanage_store.c 2007-11-05 19:01:32 UTC (rev 2670) @@ -1628,6 +1628,8 @@ ERR(sh, "Unknown/Invalid policy version %d.", policyvers); goto err; } + if (sh->conf->handle_unknown >= 0) + sepol_policydb_set_handle_unknown(out, sh->conf->handle_unknown); *policydb = out; return STATUS_SUCCESS; Modified: branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h 2007-11-05 19:01:32 UTC (rev 2670) @@ -602,9 +602,9 @@ #define POLICYDB_CONFIG_MLS 1 /* the config flags related to unknown classes/perms are bits 2 and 3 */ -#define DENY_UNKNOWN 0x00000000 -#define REJECT_UNKNOWN 0x00000002 -#define ALLOW_UNKNOWN 0x00000004 +#define DENY_UNKNOWN SEPOL_DENY_UNKNOWN +#define REJECT_UNKNOWN SEPOL_REJECT_UNKNOWN +#define ALLOW_UNKNOWN SEPOL_ALLOW_UNKNOWN #define POLICYDB_CONFIG_UNKNOWN_MASK (DENY_UNKNOWN | REJECT_UNKNOWN | ALLOW_UNKNOWN) Modified: branches/stable/1_0/libsepol/include/sepol/policydb.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb.h 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsepol/include/sepol/policydb.h 2007-11-05 19:01:32 UTC (rev 2670) @@ -83,6 +83,13 @@ */ extern int sepol_policydb_set_vers(sepol_policydb_t * p, unsigned int vers); +/* Set how to handle unknown class/perms. */ +#define SEPOL_DENY_UNKNOWN 0 +#define SEPOL_REJECT_UNKNOWN 2 +#define SEPOL_ALLOW_UNKNOWN 4 +extern int sepol_policydb_set_handle_unknown(sepol_policydb_t * p, + unsigned int handle_unknown); + /* * Read a policydb from a policy file. * This automatically sets the type and version based on the Modified: branches/stable/1_0/libsepol/src/policydb_public.c =================================================================== --- branches/stable/1_0/libsepol/src/policydb_public.c 2007-11-05 18:54:58 UTC (rev 2669) +++ branches/stable/1_0/libsepol/src/policydb_public.c 2007-11-05 19:01:32 UTC (rev 2670) @@ -134,6 +134,24 @@ return 0; } +int sepol_policydb_set_handle_unknown(sepol_policydb_t * sp, + unsigned int handle_unknown) +{ + struct policydb *p = &sp->p; + + switch (handle_unknown) { + case SEPOL_DENY_UNKNOWN: + case SEPOL_REJECT_UNKNOWN: + case SEPOL_ALLOW_UNKNOWN: + break; + default: + return -1; + } + + p->handle_unknown = handle_unknown; + return 0; +} + int sepol_policydb_read(sepol_policydb_t * p, sepol_policy_file_t * pf) { return policydb_read(&p->p, &pf->pf, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2007-11-05 19:10:28
|
Revision: 2675 http://selinux.svn.sourceforge.net/selinux/?rev=2675&view=rev Author: ssmalley Date: 2007-11-05 11:10:24 -0800 (Mon, 05 Nov 2007) Log Message: ----------- applied r2672:2674 from trunk Modified Paths: -------------- branches/stable/1_0/libsemanage/src/semanage_store.c branches/stable/1_0/libsepol/src/link.c Modified: branches/stable/1_0/libsemanage/src/semanage_store.c =================================================================== --- branches/stable/1_0/libsemanage/src/semanage_store.c 2007-11-05 19:09:04 UTC (rev 2674) +++ branches/stable/1_0/libsemanage/src/semanage_store.c 2007-11-05 19:10:24 UTC (rev 2675) @@ -547,7 +547,7 @@ free(namelist[i]); } free(namelist); - if (remove(path) == -1) { + if (rmdir(path) == -1) { return -4; } return 0; Modified: branches/stable/1_0/libsepol/src/link.c =================================================================== --- branches/stable/1_0/libsepol/src/link.c 2007-11-05 19:09:04 UTC (rev 2674) +++ branches/stable/1_0/libsepol/src/link.c 2007-11-05 19:10:24 UTC (rev 2675) @@ -695,6 +695,12 @@ return -1; } + if (!strcmp(id, target_id)) { + ERR(state->handle, "%s: Self aliasing of %s.", + state->cur_mod_name, id); + return -1; + } + base_type = hashtab_search(state->base->p_types.table, id); if (base_type == NULL) { if (state->verbose) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mil...@us...> - 2008-01-09 16:10:23
|
Revision: 2729 http://selinux.svn.sourceforge.net/selinux/?rev=2729&view=rev Author: millertc Date: 2008-01-09 08:09:26 -0800 (Wed, 09 Jan 2008) Log Message: ----------- Merge warning fixes from trunk; revs 2719-2727 inclusive Modified Paths: -------------- branches/stable/1_0/Makefile branches/stable/1_0/checkpolicy/Makefile branches/stable/1_0/checkpolicy/test/dismod.c branches/stable/1_0/checkpolicy/test/dispol.c branches/stable/1_0/libselinux/src/Makefile branches/stable/1_0/libselinux/utils/getdefaultcon.c branches/stable/1_0/libsemanage/src/Makefile branches/stable/1_0/libsemanage/src/conf-scan.l branches/stable/1_0/libsepol/include/sepol/policydb/ebitmap.h branches/stable/1_0/libsepol/include/sepol/policydb/mls_types.h branches/stable/1_0/libsepol/src/Makefile branches/stable/1_0/libsepol/src/ebitmap.c branches/stable/1_0/libsepol/src/genusers.c branches/stable/1_0/libsepol/src/hierarchy.c branches/stable/1_0/libsepol/utils/Makefile branches/stable/1_0/policycoreutils/audit2why/audit2why.c branches/stable/1_0/policycoreutils/newrole/newrole.c branches/stable/1_0/policycoreutils/secon/Makefile branches/stable/1_0/policycoreutils/semodule/semodule.c branches/stable/1_0/policycoreutils/semodule_deps/semodule_deps.c branches/stable/1_0/policycoreutils/setfiles/Makefile branches/stable/1_0/policycoreutils/setfiles/setfiles.c Modified: branches/stable/1_0/Makefile =================================================================== --- branches/stable/1_0/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -2,7 +2,7 @@ PYSUBDIRS=libselinux libsemanage ifeq ($(DEBUG),1) - export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow + export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror export LDFLAGS = -g endif Modified: branches/stable/1_0/checkpolicy/Makefile =================================================================== --- branches/stable/1_0/checkpolicy/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/checkpolicy/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -8,8 +8,10 @@ INCLUDEDIR ?= $(PREFIX)/include TARGETS = checkpolicy checkmodule -CFLAGS ?= -g -Wall -O2 -pipe -fno-strict-aliasing +YACC = bison -y +CFLAGS ?= -g -Wall -Werror -O2 -pipe -fno-strict-aliasing + override CFLAGS += -I. -I${INCLUDEDIR} CHECKOBJS = y.tab.o lex.yy.o queue.o module_compiler.o parse_util.o Modified: branches/stable/1_0/checkpolicy/test/dismod.c =================================================================== --- branches/stable/1_0/checkpolicy/test/dismod.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/checkpolicy/test/dismod.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -665,13 +665,13 @@ return 0; } -int display_handle_unknown(policydb_t * policydb, FILE * out_fp) +int display_handle_unknown(policydb_t * p, FILE * out_fp) { - if (policydb->handle_unknown == ALLOW_UNKNOWN) + if (p->handle_unknown == ALLOW_UNKNOWN) fprintf(out_fp, "Allow unknown classes and perms\n"); - else if (policydb->handle_unknown == DENY_UNKNOWN) + else if (p->handle_unknown == DENY_UNKNOWN) fprintf(out_fp, "Deny unknown classes and perms\n"); - else if (policydb->handle_unknown == REJECT_UNKNOWN) + else if (p->handle_unknown == REJECT_UNKNOWN) fprintf(out_fp, "Reject unknown classes and perms\n"); return 0; } Modified: branches/stable/1_0/checkpolicy/test/dispol.c =================================================================== --- branches/stable/1_0/checkpolicy/test/dispol.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/checkpolicy/test/dispol.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -273,13 +273,13 @@ return 1; } -int display_handle_unknown(policydb_t * policydb, FILE * out_fp) +int display_handle_unknown(policydb_t * p, FILE * out_fp) { - if (policydb->handle_unknown == ALLOW_UNKNOWN) + if (p->handle_unknown == ALLOW_UNKNOWN) fprintf(out_fp, "Allow unknown classes and permisions\n"); - else if (policydb->handle_unknown == DENY_UNKNOWN) + else if (p->handle_unknown == DENY_UNKNOWN) fprintf(out_fp, "Deny unknown classes and permisions\n"); - else if (policydb->handle_unknown == REJECT_UNKNOWN) + else if (p->handle_unknown == REJECT_UNKNOWN) fprintf(out_fp, "Reject unknown classes and permisions\n"); return 0; } Modified: branches/stable/1_0/libselinux/src/Makefile =================================================================== --- branches/stable/1_0/libselinux/src/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libselinux/src/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -20,7 +20,7 @@ LIBSO=$(TARGET).$(LIBVERSION) OBJS= $(patsubst %.c,%.o,$(filter-out $(SWIGCOUT),$(wildcard *.c))) LOBJS= $(patsubst %.c,%.lo,$(filter-out $(SWIGCOUT),$(wildcard *.c))) -CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute +CFLAGS ?= -Werror -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 RANLIB=ranlib @@ -42,7 +42,7 @@ $(RANLIB) $@ $(SWIGLOBJ): $(SWIGCOUT) - $(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $< + $(CC) $(filter-out -Werror,$(CFLAGS)) -I$(PYINC) -fPIC -DSHARED -c -o $@ $< $(SWIGSO): $(SWIGLOBJ) $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux -L$(LIBDIR) -Wl,-soname,$@ Modified: branches/stable/1_0/libselinux/utils/getdefaultcon.c =================================================================== --- branches/stable/1_0/libselinux/utils/getdefaultcon.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libselinux/utils/getdefaultcon.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -57,7 +57,7 @@ } else cur_context = argv[optind + 1]; - if (getseuserbyname(user, &seuser, &dlevel)==0) { + if ((ret = getseuserbyname(user, &seuser, &dlevel)) == 0) { if (! level) level=dlevel; if (role != NULL && role[0]) ret=get_default_context_with_rolelevel(seuser, role, level,cur_context,&usercon); Modified: branches/stable/1_0/libsemanage/src/Makefile =================================================================== --- branches/stable/1_0/libsemanage/src/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsemanage/src/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -10,7 +10,7 @@ DEFAULT_SEMANAGE_CONF_LOCATION=$(DESTDIR)/etc/selinux/semanage.conf ifeq ($(DEBUG),1) - export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow + export CFLAGS = -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror export LDFLAGS = -g endif @@ -44,7 +44,7 @@ pywrap: all $(SWIGLOBJ) $(SWIGSO) $(SWIGLOBJ): $(SWIGCOUT) - $(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $< + $(CC) $(filter-out -Werror, $(CFLAGS)) -I$(PYINC) -fPIC -DSHARED -c -o $@ $< $(SWIGSO): $(SWIGLOBJ) $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -l$(PYLIBVER) -L$(LIBDIR) -Wl,-soname,$@,-z,defs Modified: branches/stable/1_0/libsemanage/src/conf-scan.l =================================================================== --- branches/stable/1_0/libsemanage/src/conf-scan.l 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsemanage/src/conf-scan.l 2008-01-09 16:09:26 UTC (rev 2729) @@ -32,6 +32,7 @@ %} %option stack prefix="semanage_" +%option nounput noyy_push_state noyy_pop_state noyy_top_state %x arg Modified: branches/stable/1_0/libsepol/include/sepol/policydb/ebitmap.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb/ebitmap.h 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/include/sepol/policydb/ebitmap.h 2008-01-09 16:09:26 UTC (rev 2729) @@ -73,12 +73,12 @@ #define ebitmap_for_each_bit(e, n, bit) \ for (bit = ebitmap_start(e, &n); bit < ebitmap_length(e); bit = ebitmap_next(&n, bit)) \ -extern int ebitmap_cmp(ebitmap_t * e1, ebitmap_t * e2); -extern int ebitmap_or(ebitmap_t * dst, ebitmap_t * e1, ebitmap_t * e2); -extern int ebitmap_union(ebitmap_t * dst, ebitmap_t * e1); -extern int ebitmap_cpy(ebitmap_t * dst, ebitmap_t * src); -extern int ebitmap_contains(ebitmap_t * e1, ebitmap_t * e2); -extern int ebitmap_get_bit(ebitmap_t * e, unsigned int bit); +extern int ebitmap_cmp(const ebitmap_t * e1, const ebitmap_t * e2); +extern int ebitmap_or(ebitmap_t * dst, const ebitmap_t * e1, const ebitmap_t * e2); +extern int ebitmap_union(ebitmap_t * dst, const ebitmap_t * e1); +extern int ebitmap_cpy(ebitmap_t * dst, const ebitmap_t * src); +extern int ebitmap_contains(const ebitmap_t * e1, const ebitmap_t * e2); +extern int ebitmap_get_bit(const ebitmap_t * e, unsigned int bit); extern int ebitmap_set_bit(ebitmap_t * e, unsigned int bit, int value); extern void ebitmap_destroy(ebitmap_t * e); extern int ebitmap_read(ebitmap_t * e, void *fp); Modified: branches/stable/1_0/libsepol/include/sepol/policydb/mls_types.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb/mls_types.h 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/include/sepol/policydb/mls_types.h 2008-01-09 16:09:26 UTC (rev 2729) @@ -70,12 +70,12 @@ mls_level_init(level); } -static inline int mls_level_eq(struct mls_level *l1, struct mls_level *l2) +static inline int mls_level_eq(const struct mls_level *l1, const struct mls_level *l2) { return ((l1->sens == l2->sens) && ebitmap_cmp(&l1->cat, &l2->cat)); } -static inline int mls_level_dom(struct mls_level *l1, struct mls_level *l2) +static inline int mls_level_dom(const struct mls_level *l1, const struct mls_level *l2) { return ((l1->sens >= l2->sens) && ebitmap_contains(&l1->cat, &l2->cat)); } Modified: branches/stable/1_0/libsepol/src/Makefile =================================================================== --- branches/stable/1_0/libsepol/src/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/src/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -10,7 +10,7 @@ LIBSO=$(TARGET).$(LIBVERSION) OBJS= $(patsubst %.c,%.o,$(wildcard *.c)) LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c)) -CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute +CFLAGS ?= -Werror -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute override CFLAGS += -I. -I../include -D_GNU_SOURCE all: $(LIBA) $(LIBSO) Modified: branches/stable/1_0/libsepol/src/ebitmap.c =================================================================== --- branches/stable/1_0/libsepol/src/ebitmap.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/src/ebitmap.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -15,7 +15,7 @@ #include "debug.h" #include "private.h" -int ebitmap_or(ebitmap_t * dst, ebitmap_t * e1, ebitmap_t * e2) +int ebitmap_or(ebitmap_t * dst, const ebitmap_t * e1, const ebitmap_t * e2) { ebitmap_node_t *n1, *n2, *new, *prev; @@ -58,7 +58,7 @@ return 0; } -int ebitmap_union(ebitmap_t * dst, ebitmap_t * e1) +int ebitmap_union(ebitmap_t * dst, const ebitmap_t * e1) { ebitmap_t tmp; @@ -71,7 +71,7 @@ return 0; } -int ebitmap_cmp(ebitmap_t * e1, ebitmap_t * e2) +int ebitmap_cmp(const ebitmap_t * e1, const ebitmap_t * e2) { ebitmap_node_t *n1, *n2; @@ -92,7 +92,7 @@ return 1; } -int ebitmap_cpy(ebitmap_t * dst, ebitmap_t * src) +int ebitmap_cpy(ebitmap_t * dst, const ebitmap_t * src) { ebitmap_node_t *n, *new, *prev; @@ -121,7 +121,7 @@ return 0; } -int ebitmap_contains(ebitmap_t * e1, ebitmap_t * e2) +int ebitmap_contains(const ebitmap_t * e1, const ebitmap_t * e2) { ebitmap_node_t *n1, *n2; @@ -148,7 +148,7 @@ return 1; } -int ebitmap_get_bit(ebitmap_t * e, unsigned int bit) +int ebitmap_get_bit(const ebitmap_t * e, unsigned int bit) { ebitmap_node_t *n; Modified: branches/stable/1_0/libsepol/src/genusers.c =================================================================== --- branches/stable/1_0/libsepol/src/genusers.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/src/genusers.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -117,17 +117,18 @@ } else islist = 0; + oldc = 0; do { while (*p && isspace(*p)) p++; if (!(*p)) - BADLINE(); + break; q = p; while (*p && *p != ';' && *p != '}' && !isspace(*p)) p++; if (!(*p)) - BADLINE(); + break; if (*p == '}') islist = 0; oldc = *p; @@ -153,6 +154,8 @@ } } } while (islist); + if (oldc == 0) + BADLINE(); if (policydb->mls) { context_struct_t context; Modified: branches/stable/1_0/libsepol/src/hierarchy.c =================================================================== --- branches/stable/1_0/libsepol/src/hierarchy.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/src/hierarchy.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -130,7 +130,7 @@ avtab_key_t key; avtab_datum_t *avdatump; hierarchy_args_t *a; - uint32_t av; + uint32_t av = 0; type_datum_t *t = NULL, *t2 = NULL; if (!(k->specified & AVTAB_ALLOWED)) { @@ -164,8 +164,7 @@ return 0; } av = avdatump->data; - } else - av = 0; + } if (a->opt_cond_list) { /* if a conditional list is present search it before continuing */ avdatump = cond_av_list_search(&key, a->opt_cond_list); @@ -202,8 +201,7 @@ return 0; } av = avdatump->data; - } else - av = 0; + } if (a->opt_cond_list) { /* if a conditional list is present search it before continuing */ avdatump = cond_av_list_search(&key, a->opt_cond_list); @@ -228,8 +226,7 @@ return 0; } av = avdatump->data; - } else - av = 0; + } if (a->opt_cond_list) { /* if a conditional list is present search it before continuing */ avdatump = cond_av_list_search(&key, a->opt_cond_list); Modified: branches/stable/1_0/libsepol/utils/Makefile =================================================================== --- branches/stable/1_0/libsepol/utils/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/libsepol/utils/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -2,7 +2,7 @@ PREFIX ?= $(DESTDIR)/usr BINDIR ?= $(PREFIX)/bin -CFLAGS ?= -Wall +CFLAGS ?= -Wall -Werror override CFLAGS += -I../include LDLIBS += -L../src -lsepol Modified: branches/stable/1_0/policycoreutils/audit2why/audit2why.c =================================================================== --- branches/stable/1_0/policycoreutils/audit2why/audit2why.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/audit2why/audit2why.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -28,7 +28,7 @@ char *buffer = NULL, *bufcopy = NULL; unsigned int lineno = 0; size_t len = 0, bufcopy_len = 0; - FILE *fp; + FILE *fp = NULL; int opt, rc, set_path = 0; char *p, *scon, *tcon, *tclassstr, *permstr; sepol_security_id_t ssid, tsid; Modified: branches/stable/1_0/policycoreutils/newrole/newrole.c =================================================================== --- branches/stable/1_0/policycoreutils/newrole/newrole.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/newrole/newrole.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -1081,13 +1081,13 @@ * since we are doing cleanup which needs to be done. * We can exit with a bad rc though */ - int rc; + pid_t pid; int exit_code = 0; int status; do { - rc = wait(&status); - } while (rc < 0 && errno == EINTR); + pid = wait(&status); + } while (pid < 0 && errno == EINTR); /* Preserve child exit status, unless there is another error. */ if (WIFEXITED(status)) Modified: branches/stable/1_0/policycoreutils/secon/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/secon/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/secon/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -5,7 +5,7 @@ MANDIR ?= $(PREFIX)/share/man LIBDIR ?= ${PREFIX}/lib -WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal +WARNS=-Werror -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal VERSION = $(shell cat ../VERSION) CFLAGS ?= $(WARNS) -O1 override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) Modified: branches/stable/1_0/policycoreutils/semodule/semodule.c =================================================================== --- branches/stable/1_0/policycoreutils/semodule/semodule.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/semodule/semodule.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -339,8 +339,8 @@ for (i = 0; i < num_commands; i++) { enum client_modes mode = commands[i].mode; char *mode_arg = commands[i].arg; - char *data; - size_t data_len; + char *data = NULL; + size_t data_len = 0; if (mode == INSTALL_M || mode == UPGRADE_M || mode == BASE_M) { if ((data_len = map_file(mode_arg, &data)) == 0) { fprintf(stderr, Modified: branches/stable/1_0/policycoreutils/semodule_deps/semodule_deps.c =================================================================== --- branches/stable/1_0/policycoreutils/semodule_deps/semodule_deps.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/semodule_deps/semodule_deps.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -138,7 +138,7 @@ * of the policy. * - levels / cats: can't be required or used in modules. */ -static int generate_requires(policydb_t * p, hashtab_t * r) +static hashtab_t generate_requires(policydb_t * p) { avrule_block_t *block; avrule_decl_t *decl; @@ -153,7 +153,7 @@ mods = hashtab_create(reqsymhash, reqsymcmp, 64); if (mods == NULL) - return -1; + return NULL; for (block = p->global; block != NULL; block = block->next) { if (block->flags & AVRULE_OPTIONAL) @@ -195,14 +195,14 @@ reqsymcmp, 64); if (reqs == NULL) { - return -1; + return NULL; } ret = hashtab_insert(mods, mod_name, reqs); if (ret != HASHTAB_SUCCESS) - return ret; + return NULL; } ret = hashtab_insert(reqs, req_name, @@ -210,16 +210,14 @@ if (! (ret == HASHTAB_PRESENT || ret == HASHTAB_SUCCESS)) - return -1; + return NULL; } } } } - *r = mods; - - return 0; + return mods; } static void free_requires(hashtab_t req) @@ -322,6 +320,7 @@ int verbose = 0, exclude_base = 1, command = SHOW_DEPS; char *basename; sepol_module_package_t *base, **mods; + policydb_t *p; hashtab_t req; while ((ch = getopt(argc, argv, "vgb")) != EOF) { @@ -382,10 +381,14 @@ exit(1); } - if (generate_requires - ((policydb_t *) sepol_module_package_get_policy(base), &req) < 0) + p = (policydb_t *) sepol_module_package_get_policy(base); + if (p == NULL) exit(1); + req = generate_requires(p); + if (req == NULL) + exit(1); + if (command == SHOW_DEPS) output_requirements(req, exclude_base, stdout); else Modified: branches/stable/1_0/policycoreutils/setfiles/Makefile =================================================================== --- branches/stable/1_0/policycoreutils/setfiles/Makefile 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/setfiles/Makefile 2008-01-09 16:09:26 UTC (rev 2729) @@ -6,7 +6,7 @@ AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null) -CFLAGS = -Werror -Wall -W +CFLAGS = -Werror -Wall -W override CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(PREFIX)/include LDLIBS = -lselinux -lsepol -L$(LIBDIR) Modified: branches/stable/1_0/policycoreutils/setfiles/setfiles.c =================================================================== --- branches/stable/1_0/policycoreutils/setfiles/setfiles.c 2008-01-09 15:49:07 UTC (rev 2728) +++ branches/stable/1_0/policycoreutils/setfiles/setfiles.c 2008-01-09 16:09:26 UTC (rev 2729) @@ -109,7 +109,7 @@ static int quiet = 0; static int use_stdin = 0; static int verbose = 0; -static int log = 0; +static int logging = 0; static int warn_no_match = 0; static char *rootpath = NULL; static int rootpathlen = 0; @@ -375,7 +375,7 @@ } } - if (log && !user_only_changed) { + if (logging && !user_only_changed) { if (context) syslog(LOG_INFO, "relabeling %s from %s to %s\n", my_file, context, newcon); @@ -562,7 +562,7 @@ debug = 1; break; case 'l': - log = 1; + logging = 1; break; case 'F': force = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mil...@us...> - 2008-02-11 16:10:02
|
Revision: 2803 http://selinux.svn.sourceforge.net/selinux/?rev=2803&view=rev Author: millertc Date: 2008-02-11 08:10:00 -0800 (Mon, 11 Feb 2008) Log Message: ----------- Disable generation of the unused input() function in the lexer. Quiets a gcc warning that breaks the build for newer versions of flex. Modified Paths: -------------- branches/stable/1_0/checkpolicy/policy_scan.l branches/stable/1_0/libsemanage/src/conf-scan.l Modified: branches/stable/1_0/checkpolicy/policy_scan.l =================================================================== --- branches/stable/1_0/checkpolicy/policy_scan.l 2008-02-08 18:10:06 UTC (rev 2802) +++ branches/stable/1_0/checkpolicy/policy_scan.l 2008-02-11 16:10:00 UTC (rev 2803) @@ -41,7 +41,7 @@ unsigned int policydb_errors = 0; %} -%option nounput +%option noinput nounput %array letter [A-Za-z] Modified: branches/stable/1_0/libsemanage/src/conf-scan.l =================================================================== --- branches/stable/1_0/libsemanage/src/conf-scan.l 2008-02-08 18:10:06 UTC (rev 2802) +++ branches/stable/1_0/libsemanage/src/conf-scan.l 2008-02-11 16:10:00 UTC (rev 2803) @@ -32,7 +32,7 @@ %} %option stack prefix="semanage_" -%option nounput noyy_push_state noyy_pop_state noyy_top_state +%option noinput nounput noyy_push_state noyy_pop_state noyy_top_state %x arg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2008-03-04 18:34:16
|
Revision: 2834 http://selinux.svn.sourceforge.net/selinux/?rev=2834&view=rev Author: ssmalley Date: 2008-03-04 10:34:07 -0800 (Tue, 04 Mar 2008) Log Message: ----------- applied r2830:2831 from trunk Modified Paths: -------------- branches/stable/1_0/checkpolicy/checkmodule.c branches/stable/1_0/checkpolicy/checkpolicy.c branches/stable/1_0/checkpolicy/test/dismod.c branches/stable/1_0/checkpolicy/test/dispol.c branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h branches/stable/1_0/libsepol/src/genbools.c branches/stable/1_0/libsepol/src/module.c branches/stable/1_0/libsepol/src/policydb.c branches/stable/1_0/libsepol/src/policydb_convert.c branches/stable/1_0/libsepol/src/services.c Modified: branches/stable/1_0/checkpolicy/checkmodule.c =================================================================== --- branches/stable/1_0/checkpolicy/checkmodule.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/checkpolicy/checkmodule.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -71,6 +71,7 @@ fprintf(stderr, "Can't map '%s': %s\n", file, strerror(errno)); return -1; } + policy_file_init(&f); f.type = PF_USE_MEMORY; f.data = map; f.len = sb.st_size; @@ -124,6 +125,7 @@ p->policyvers = policyvers; p->handle_unknown = handle_unknown; + policy_file_init(&pf); pf.type = PF_USE_STDIO; pf.fp = outfp; ret = policydb_write(p, &pf); Modified: branches/stable/1_0/checkpolicy/checkpolicy.c =================================================================== --- branches/stable/1_0/checkpolicy/checkpolicy.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/checkpolicy/checkpolicy.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -489,6 +489,7 @@ file, strerror(errno)); exit(1); } + policy_file_init(&pf); pf.type = PF_USE_MEMORY; pf.data = map; pf.len = sb.st_size; @@ -577,6 +578,7 @@ policydb.policy_type = POLICY_KERN; policydb.policyvers = policyvers; + policy_file_init(&pf); pf.type = PF_USE_STDIO; pf.fp = outfp; ret = policydb_write(&policydb, &pf); Modified: branches/stable/1_0/checkpolicy/test/dismod.c =================================================================== --- branches/stable/1_0/checkpolicy/test/dismod.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/checkpolicy/test/dismod.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -688,6 +688,7 @@ filename, strerror(errno)); exit(1); } + policy_file_init(&f); f.type = PF_USE_STDIO; f.fp = in_fp; Modified: branches/stable/1_0/checkpolicy/test/dispol.c =================================================================== --- branches/stable/1_0/checkpolicy/test/dispol.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/checkpolicy/test/dispol.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -351,6 +351,7 @@ /* read the binary policy */ fprintf(out_fp, "Reading policy...\n"); + policy_file_init(&pf); pf.type = PF_USE_MEMORY; pf.data = map; pf.len = sb.st_size; Modified: branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/libsepol/include/sepol/policydb/policydb.h 2008-03-04 18:34:07 UTC (rev 2834) @@ -566,6 +566,8 @@ struct policy_file pf; }; +extern void policy_file_init(policy_file_t * x); + extern int policydb_read(policydb_t * p, struct policy_file *fp, unsigned int verbose); extern int avrule_read_list(policydb_t * p, avrule_t ** avrules, Modified: branches/stable/1_0/libsepol/src/genbools.c =================================================================== --- branches/stable/1_0/libsepol/src/genbools.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/libsepol/src/genbools.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -154,6 +154,7 @@ goto err_destroy; } + policy_file_init(&pf); pf.type = PF_USE_MEMORY; pf.data = data; pf.len = len; @@ -225,6 +226,7 @@ goto err_destroy; } + policy_file_init(&pf); pf.type = PF_USE_MEMORY; pf.data = data; pf.len = len; Modified: branches/stable/1_0/libsepol/src/module.c =================================================================== --- branches/stable/1_0/libsepol/src/module.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/libsepol/src/module.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -851,9 +851,8 @@ if (p->policy) { /* compute policy length */ + policy_file_init(&polfile); polfile.type = PF_LEN; - polfile.data = NULL; - polfile.len = 0; polfile.handle = file->handle; if (policydb_write(&p->policy->p, &polfile)) return -1; Modified: branches/stable/1_0/libsepol/src/policydb.c =================================================================== --- branches/stable/1_0/libsepol/src/policydb.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/libsepol/src/policydb.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -3256,3 +3256,8 @@ return 0; } + +void policy_file_init(policy_file_t *pf) +{ + memset(pf, 0, sizeof(policy_file_t)); +} Modified: branches/stable/1_0/libsepol/src/policydb_convert.c =================================================================== --- branches/stable/1_0/libsepol/src/policydb_convert.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/libsepol/src/policydb_convert.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -13,6 +13,7 @@ policy_file_t pf; + policy_file_init(&pf); pf.type = PF_USE_MEMORY; pf.data = data; pf.len = len; @@ -39,9 +40,8 @@ struct policydb tmp_policydb; /* Compute the length for the new policy image. */ + policy_file_init(&pf); pf.type = PF_LEN; - pf.data = NULL; - pf.len = 0; pf.handle = handle; if (policydb_write(policydb, &pf)) { ERR(handle, "could not compute policy length"); Modified: branches/stable/1_0/libsepol/src/services.c =================================================================== --- branches/stable/1_0/libsepol/src/services.c 2008-03-04 17:31:32 UTC (rev 2833) +++ branches/stable/1_0/libsepol/src/services.c 2008-03-04 18:34:07 UTC (rev 2834) @@ -85,6 +85,8 @@ int sepol_set_policydb_from_file(FILE * fp) { struct policy_file pf; + + policy_file_init(&pf); pf.fp = fp; pf.type = PF_USE_STDIO; if (mypolicydb.policy_type) @@ -951,13 +953,14 @@ convert_context_args_t args; uint32_t seqno; int rc = 0; - struct policy_file file = { - .type = PF_USE_MEMORY, - .data = data, - .len = len, - .fp = NULL - }, *fp = &file; + struct policy_file file, *fp; + policy_file_init(&file); + file.type = PF_USE_MEMORY; + file.data = data; + file.len = len; + fp = &file; + if (policydb_init(&newpolicydb)) return -ENOMEM; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ssm...@us...> - 2008-06-10 13:05:23
|
Revision: 2900 http://selinux.svn.sourceforge.net/selinux/?rev=2900&view=rev Author: ssmalley Date: 2008-06-10 06:05:20 -0700 (Tue, 10 Jun 2008) Log Message: ----------- applied r2885:2886 from trunk Modified Paths: -------------- branches/stable/1_0/checkpolicy/policy_parse.y branches/stable/1_0/libsepol/include/sepol/policydb/expand.h branches/stable/1_0/libsepol/src/expand.c branches/stable/1_0/libsepol/src/policydb.c branches/stable/1_0/libsepol/src/users.c Modified: branches/stable/1_0/checkpolicy/policy_parse.y =================================================================== --- branches/stable/1_0/checkpolicy/policy_parse.y 2008-06-06 14:43:16 UTC (rev 2899) +++ branches/stable/1_0/checkpolicy/policy_parse.y 2008-06-10 13:05:20 UTC (rev 2900) @@ -2729,7 +2729,7 @@ } /* This ebitmap business is just to ensure that there are not conflicting role_trans rules */ - if (role_set_expand(&roles, &e_roles, policydbp)) + if (role_set_expand(&roles, &e_roles, policydbp, NULL)) goto bad; if (type_set_expand(&types, &e_types, policydbp, 1)) Modified: branches/stable/1_0/libsepol/include/sepol/policydb/expand.h =================================================================== --- branches/stable/1_0/libsepol/include/sepol/policydb/expand.h 2008-06-06 14:43:16 UTC (rev 2899) +++ branches/stable/1_0/libsepol/include/sepol/policydb/expand.h 2008-06-10 13:05:20 UTC (rev 2900) @@ -43,6 +43,7 @@ */ extern int expand_module_avrules(sepol_handle_t * handle, policydb_t * base, policydb_t * out, uint32_t * typemap, uint32_t * boolmap, + uint32_t * rolemap, uint32_t * usermap, int verbose, int expand_neverallow); /* * Expand all parts of a module. Neverallow rules are not expanded (only @@ -59,7 +60,7 @@ unsigned char alwaysexpand); extern int type_set_expand(type_set_t * set, ebitmap_t * t, policydb_t * p, unsigned char alwaysexpand); -extern int role_set_expand(role_set_t * x, ebitmap_t * r, policydb_t * p); +extern int role_set_expand(role_set_t * x, ebitmap_t * r, policydb_t * p, uint32_t * rolemap); extern int mls_semantic_level_expand(mls_semantic_level_t *sl, mls_level_t *l, policydb_t *p, sepol_handle_t *h); extern int mls_semantic_range_expand(mls_semantic_range_t *sr, mls_range_t *r, Modified: branches/stable/1_0/libsepol/src/expand.c =================================================================== --- branches/stable/1_0/libsepol/src/expand.c 2008-06-06 14:43:16 UTC (rev 2899) +++ branches/stable/1_0/libsepol/src/expand.c 2008-06-10 13:05:20 UTC (rev 2900) @@ -40,6 +40,8 @@ int verbose; uint32_t *typemap; uint32_t *boolmap; + uint32_t *rolemap; + uint32_t *usermap; policydb_t *base; policydb_t *out; sepol_handle_t *handle; @@ -51,6 +53,23 @@ memset(state, 0, sizeof(expand_state_t)); } +static int map_ebitmap(ebitmap_t * src, ebitmap_t * dst, uint32_t * map) +{ + unsigned int i; + ebitmap_node_t *tnode; + ebitmap_init(dst); + + ebitmap_for_each_bit(src, tnode, i) { + if (!ebitmap_node_get_bit(tnode, i)) + continue; + if (!map[i]) + continue; + if (ebitmap_set_bit(dst, map[i] - 1, 1)) + return -1; + } + return 0; +} + static int type_copy_callback(hashtab_key_t key, hashtab_datum_t datum, void *data) { @@ -142,7 +161,7 @@ ERR(state->handle, "attribute %s vanished!", id); return -1; } - if (convert_type_ebitmap(&type->types, &tmp_union, state->typemap)) { + if (map_ebitmap(&type->types, &tmp_union, state->typemap)) { ERR(state->handle, "out of memory"); return -1; } @@ -289,6 +308,14 @@ names, 1)) { goto out_of_mem; } + } else if (new_expr->attr & CEXPR_ROLE) { + if (map_ebitmap(&expr->names, &new_expr->names, state->rolemap)) { + goto out_of_mem; + } + } else if (new_expr->attr & CEXPR_USER) { + if (map_ebitmap(&expr->names, &new_expr->names, state->usermap)) { + goto out_of_mem; + } } else { /* Other kinds of sets do not. */ if (ebitmap_cpy(&new_expr->names, @@ -494,6 +521,28 @@ return 0; } +static int role_remap_dominates(hashtab_key_t key __attribute__ ((unused)), hashtab_datum_t datum, void *data) +{ + ebitmap_t mapped_roles; + role_datum_t *role = (role_datum_t *) datum; + expand_state_t *state = (expand_state_t *) data; + + if (!(&role->dominates.node)) + return 0; + + if (map_ebitmap(&role->dominates, &mapped_roles, state->rolemap)) + return -1; + + ebitmap_destroy(&role->dominates); + + if (ebitmap_cpy(&role->dominates, &mapped_roles)) + return -1; + + ebitmap_destroy(&mapped_roles); + + return 0; +} + static int role_copy_callback(hashtab_key_t key, hashtab_datum_t datum, void *data) { @@ -508,8 +557,11 @@ role = (role_datum_t *) datum; state = (expand_state_t *) data; - if (strcmp(id, OBJECT_R) == 0) + if (strcmp(id, OBJECT_R) == 0) { + /* object_r is always value 1 */ + state->rolemap[role->s.value - 1] = 1; return 0; + } if (!is_id_enabled(id, state->base, SYM_ROLES)) { /* identifier's scope is not enabled */ @@ -535,8 +587,9 @@ return -1; } - new_role->s.value = role->s.value; state->out->p_roles.nprim++; + new_role->s.value = state->out->p_roles.nprim; + state->rolemap[role->s.value - 1] = new_role->s.value; ret = hashtab_insert(state->out->p_roles.table, (hashtab_key_t) new_id, (hashtab_datum_t) new_role); @@ -553,6 +606,10 @@ ebitmap_init(&new_role->dominates); } + + /* The dominates bitmap is going to be wrong for the moment, + * we'll come back later and remap them, after we are sure all + * the roles have been added */ if (ebitmap_union(&new_role->dominates, &role->dominates)) { ERR(state->handle, "Out of memory!"); return -1; @@ -675,8 +732,9 @@ } memset(new_user, 0, sizeof(user_datum_t)); - new_user->s.value = user->s.value; state->out->p_users.nprim++; + new_user->s.value = state->out->p_users.nprim; + state->usermap[user->s.value - 1] = new_user->s.value; new_id = strdup(id); if (!new_id) { @@ -739,7 +797,7 @@ ebitmap_init(&tmp_union); /* get global roles for this user */ - if (role_set_expand(&user->roles, &tmp_union, state->base)) { + if (role_set_expand(&user->roles, &tmp_union, state->base, state->rolemap)) { ERR(state->handle, "Out of memory!"); ebitmap_destroy(&tmp_union); return -1; @@ -921,14 +979,16 @@ ebitmap_init(&roles); ebitmap_init(&new_roles); - if (role_set_expand(&cur->roles, &roles, state->out)) { + if (role_set_expand(&cur->roles, &roles, state->out, state->rolemap)) { ERR(state->handle, "Out of memory!"); return -1; } - if (role_set_expand(&cur->new_roles, &new_roles, state->out)) { + + if (role_set_expand(&cur->new_roles, &new_roles, state->out, state->rolemap)) { ERR(state->handle, "Out of memory!"); return -1; } + ebitmap_for_each_bit(&roles, snode, i) { if (!ebitmap_node_get_bit(snode, i)) continue; @@ -988,7 +1048,7 @@ ebitmap_init(&roles); ebitmap_init(&types); - if (role_set_expand(&cur->roles, &roles, state->out)) { + if (role_set_expand(&cur->roles, &roles, state->out, state->rolemap)) { ERR(state->handle, "Out of memory!"); return -1; } @@ -1041,7 +1101,7 @@ memset(n, 0, sizeof(role_trans_t)); n->role = i + 1; n->type = j + 1; - n->new_role = cur->new_role; + n->new_role = state->rolemap[cur->new_role - 1]; if (l) { l->next = n; } else { @@ -1641,8 +1701,8 @@ static int context_copy(context_struct_t * dst, context_struct_t * src, expand_state_t * state) { - dst->user = src->user; - dst->role = src->role; + dst->user = state->usermap[src->user - 1]; + dst->role = state->rolemap[src->role - 1]; dst->type = state->typemap[src->type - 1]; return mls_context_cpy(dst, src); } @@ -1825,23 +1885,6 @@ return 0; } -int convert_type_ebitmap(ebitmap_t * src, ebitmap_t * dst, uint32_t * typemap) -{ - unsigned int i; - ebitmap_node_t *tnode; - ebitmap_init(dst); - - ebitmap_for_each_bit(src, tnode, i) { - if (!ebitmap_node_get_bit(tnode, i)) - continue; - if (!typemap[i]) - continue; - if (ebitmap_set_bit(dst, typemap[i] - 1, 1)) - return -1; - } - return 0; -} - /* converts typeset using typemap and expands into ebitmap_t types using the attributes in the passed in policy. * this should not be called until after all the blocks have been processed and the attributes in target policy * are complete. */ @@ -1853,10 +1896,10 @@ type_set_init(&tmpset); - if (convert_type_ebitmap(&set->types, &tmpset.types, typemap)) + if (map_ebitmap(&set->types, &tmpset.types, typemap)) return -1; - if (convert_type_ebitmap(&set->negset, &tmpset.negset, typemap)) + if (map_ebitmap(&set->negset, &tmpset.negset, typemap)) return -1; tmpset.flags = set->flags; @@ -1898,12 +1941,14 @@ return retval; } -int role_set_expand(role_set_t * x, ebitmap_t * r, policydb_t * p) +int role_set_expand(role_set_t * x, ebitmap_t * r, policydb_t * p, uint32_t * rolemap) { unsigned int i; ebitmap_node_t *rnode; + ebitmap_t mapped_roles; ebitmap_init(r); + ebitmap_init(&mapped_roles); if (x->flags & ROLE_STAR) { for (i = 0; i < p->p_roles.nprim++; i++) @@ -1912,13 +1957,23 @@ return 0; } - ebitmap_for_each_bit(&x->roles, rnode, i) { + if (rolemap) { + if (map_ebitmap(&x->roles, &mapped_roles, rolemap)) + return -1; + } else { + if (ebitmap_cpy(&mapped_roles, &x->roles)) + return -1; + } + + ebitmap_for_each_bit(&mapped_roles, rnode, i) { if (ebitmap_node_get_bit(rnode, i)) { if (ebitmap_set_bit(r, i, 1)) return -1; } } + ebitmap_destroy(&mapped_roles); + /* if role is to be complimented, invert the entire bitmap here */ if (x->flags & ROLE_COMP) { for (i = 0; i < ebitmap_length(r); i++) { @@ -2200,7 +2255,8 @@ */ int expand_module_avrules(sepol_handle_t * handle, policydb_t * base, policydb_t * out, uint32_t * typemap, - uint32_t * boolmap, int verbose, + uint32_t * boolmap, uint32_t * rolemap, + uint32_t * usermap, int verbose, int expand_neverallow) { expand_state_t state; @@ -2211,6 +2267,8 @@ state.out = out; state.typemap = typemap; state.boolmap = boolmap; + state.rolemap = rolemap; + state.usermap = usermap; state.handle = handle; state.verbose = verbose; state.expand_neverallow = expand_neverallow; @@ -2264,6 +2322,18 @@ goto cleanup; } + state.rolemap = (uint32_t *)calloc(state.base->p_roles.nprim, sizeof(uint32_t)); + if (!state.rolemap) { + ERR(handle, "Out of memory!"); + goto cleanup; + } + + state.usermap = (uint32_t *)calloc(state.base->p_users.nprim, sizeof(uint32_t)); + if (!state.usermap) { + ERR(handle, "Out of memory!"); + goto cleanup; + } + /* order is important - types must be first */ /* copy types */ @@ -2360,6 +2430,11 @@ } + /* remap role dominates bitmaps */ + if (hashtab_map(state.out->p_roles.table, role_remap_dominates, &state)) { + goto cleanup; + } + if (copy_and_expand_avrule_block(&state) < 0) { ERR(handle, "Error during expand"); goto cleanup; @@ -2419,6 +2494,8 @@ cleanup: free(state.typemap); free(state.boolmap); + free(state.rolemap); + free(state.usermap); return retval; } Modified: branches/stable/1_0/libsepol/src/policydb.c =================================================================== --- branches/stable/1_0/libsepol/src/policydb.c 2008-06-06 14:43:16 UTC (rev 2899) +++ branches/stable/1_0/libsepol/src/policydb.c 2008-06-10 13:05:20 UTC (rev 2900) @@ -521,7 +521,7 @@ p = (policydb_t *) arg; ebitmap_destroy(&user->cache); - if (role_set_expand(&user->roles, &user->cache, p)) { + if (role_set_expand(&user->roles, &user->cache, p, NULL)) { return -1; } Modified: branches/stable/1_0/libsepol/src/users.c =================================================================== --- branches/stable/1_0/libsepol/src/users.c 2008-06-06 14:43:16 UTC (rev 2899) +++ branches/stable/1_0/libsepol/src/users.c 2008-06-10 13:05:20 UTC (rev 2900) @@ -260,7 +260,7 @@ /* Expand roles */ if (role_set_expand - (&usrdatum->roles, &usrdatum->cache, policydb)) { + (&usrdatum->roles, &usrdatum->cache, policydb, NULL)) { ERR(handle, "unable to expand role set"); goto err; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |