|
From: <ssm...@us...> - 2007-04-12 18:44:44
|
Revision: 2344
http://svn.sourceforge.net/selinux/?rev=2344&view=rev
Author: ssmalley
Date: 2007-04-12 11:43:58 -0700 (Thu, 12 Apr 2007)
Log Message:
-----------
Ported r2338 thru r2343 (seobject use first alias, rpm_execcon python binding fix, getsebool -a EACCES handling, matchpathcon and checkmodule man page fixes) from trunk.
Modified Paths:
--------------
branches/policyrep/checkpolicy/ChangeLog
branches/policyrep/checkpolicy/VERSION
branches/policyrep/checkpolicy/checkmodule.8
branches/policyrep/libselinux/ChangeLog
branches/policyrep/libselinux/VERSION
branches/policyrep/libselinux/man/man8/matchpathcon.8
branches/policyrep/libselinux/src/selinuxswig.i
branches/policyrep/libselinux/src/selinuxswig_wrap.c
branches/policyrep/libselinux/utils/getsebool.c
branches/policyrep/policycoreutils/ChangeLog
branches/policyrep/policycoreutils/VERSION
branches/policyrep/policycoreutils/semanage/seobject.py
Modified: branches/policyrep/checkpolicy/ChangeLog
===================================================================
--- branches/policyrep/checkpolicy/ChangeLog 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/checkpolicy/ChangeLog 2007-04-12 18:43:58 UTC (rev 2344)
@@ -1,3 +1,6 @@
+2.0.2 2007-04-12
+ * Merged checkmodule man page fix from Dan Walsh.
+
2.0.1 2007-02-20
* Merged patch to allow dots in class identifiers from Caleb Case.
Modified: branches/policyrep/checkpolicy/VERSION
===================================================================
--- branches/policyrep/checkpolicy/VERSION 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/checkpolicy/VERSION 2007-04-12 18:43:58 UTC (rev 2344)
@@ -1 +1 @@
-2.0.1
+2.0.2
Modified: branches/policyrep/checkpolicy/checkmodule.8
===================================================================
--- branches/policyrep/checkpolicy/checkmodule.8 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/checkpolicy/checkmodule.8 2007-04-12 18:43:58 UTC (rev 2344)
@@ -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/policyrep/libselinux/ChangeLog
===================================================================
--- branches/policyrep/libselinux/ChangeLog 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/libselinux/ChangeLog 2007-04-12 18:43:58 UTC (rev 2344)
@@ -1,3 +1,6 @@
+2.0.13 2007-04-12
+ * Merged rpm_execcon python binding fix, matchpathcon man page fix, and getsebool -a handling for EACCES from Dan Walsh.
+
2.0.12 2007-04-09
* Merged support for getting initial contexts from James Carter.
Modified: branches/policyrep/libselinux/VERSION
===================================================================
--- branches/policyrep/libselinux/VERSION 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/libselinux/VERSION 2007-04-12 18:43:58 UTC (rev 2344)
@@ -1 +1 @@
-2.0.12
+2.0.13
Modified: branches/policyrep/libselinux/man/man8/matchpathcon.8
===================================================================
--- branches/policyrep/libselinux/man/man8/matchpathcon.8 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/libselinux/man/man8/matchpathcon.8 2007-04-12 18:43:58 UTC (rev 2344)
@@ -28,4 +28,4 @@
.SH "SEE ALSO"
.BR selinux "(8), "
-.BR mathpathcon "(3), "
+.BR matchpathcon "(3), "
Modified: branches/policyrep/libselinux/src/selinuxswig.i
===================================================================
--- branches/policyrep/libselinux/src/selinuxswig.i 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/libselinux/src/selinuxswig.i 2007-04-12 18:43:58 UTC (rev 2344)
@@ -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/policyrep/libselinux/src/selinuxswig_wrap.c
===================================================================
--- branches/policyrep/libselinux/src/selinuxswig_wrap.c 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/libselinux/src/selinuxswig_wrap.c 2007-04-12 18:43:58 UTC (rev 2344)
@@ -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/policyrep/libselinux/utils/getsebool.c
===================================================================
--- branches/policyrep/libselinux/utils/getsebool.c 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/libselinux/utils/getsebool.c 2007-04-12 18:43:58 UTC (rev 2344)
@@ -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;
Modified: branches/policyrep/policycoreutils/ChangeLog
===================================================================
--- branches/policyrep/policycoreutils/ChangeLog 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/policycoreutils/ChangeLog 2007-04-12 18:43:58 UTC (rev 2344)
@@ -1,3 +1,6 @@
+2.0.9 2007-04-12
+ * Merged seobject setransRecords patch to return the first alias from Xavier Toth.
+
2.0.8 2007-04-10
* Merged updates to sepolgen-ifgen from Karl MacMillan.
Modified: branches/policyrep/policycoreutils/VERSION
===================================================================
--- branches/policyrep/policycoreutils/VERSION 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/policycoreutils/VERSION 2007-04-12 18:43:58 UTC (rev 2344)
@@ -1 +1 @@
-2.0.8
+2.0.9
Modified: branches/policyrep/policycoreutils/semanage/seobject.py
===================================================================
--- branches/policyrep/policycoreutils/semanage/seobject.py 2007-04-12 18:34:21 UTC (rev 2343)
+++ branches/policyrep/policycoreutils/semanage/seobject.py 2007-04-12 18:43:58 UTC (rev 2344)
@@ -154,7 +154,8 @@
if len(i) != 2:
self.comments.append(r)
continue
- self.ddict[i[0]] = i[1]
+ if self.ddict.has_key(i[0]) == 0:
+ self.ddict[i[0]] = i[1]
def get_all(self):
return self.ddict
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|