diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 3eaa55f..ddefb7a 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,46 +1,25 @@ -Index: libselinux/src/selinuxswig_python.i -=================================================================== ---- libselinux/src/selinuxswig_python.i (revision 2549) -+++ libselinux/src/selinuxswig_python.i (working copy) -@@ -98,4 +98,41 @@ - } - } - -+%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" +diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.33/src/matchpathcon.c +--- nsalibselinux/src/matchpathcon.c 2007-08-10 11:58:34.000000000 -0400 ++++ libselinux-2.0.33/src/matchpathcon.c 2007-09-18 11:28:07.000000000 -0400 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include "selinux_internal.h" + #include "label_internal.h" + #include "callbacks.h" +@@ -55,10 +56,12 @@ + #endif + default_printf(const char *fmt, ...) + { ++ char buf[BUFSIZ]; + va_list ap; + va_start(ap, fmt); +- vfprintf(stderr, fmt, ap); ++ vsnprintf(buf, sizeof(buf) - 1, fmt, ap); + va_end(ap); ++ syslog(LOG_ERR, buf, strlen(buf)); + } + + void diff --git a/libselinux.spec b/libselinux.spec index fa6884e..dec06f9 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -2,10 +2,11 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 2.0.33 -Release: 1%{?dist} +Release: 2%{?dist} License: Public domain (uncopyrighted) Group: System Environment/Libraries Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz +Patch: libselinux-rhat.patch BuildRequires: libsepol-devel >= %{libsepolver} swig Requires: libsepol >= %{libsepolver} @@ -48,6 +49,7 @@ needed for developing SELinux applications. %prep %setup -q +%patch -p1 -b .rhat %build make clean @@ -122,6 +124,9 @@ exit 0 %changelog +* Tue Sep 18 2007 Dan Walsh - 2.0.33-2 +- Change matchpatcon to use syslog instead of syserror + * Thu Sep 13 2007 Dan Walsh - 2.0.33-1 - Upgrade to latest from NSA * Re-map a getxattr return value of 0 to a getfilecon return value of -1 with errno EOPNOTSUPP from Stephen Smalley.