From 6a9919e596ece924a77ef401d5b8df20e1139076 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sep 06 2007 12:37:00 +0000 Subject: *** empty log message *** --- diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 7da7f04..3eaa55f 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,12 +1,46 @@ -diff --exclude-from=exclude -N -u -r nsalibselinux/src/matchpathcon.c libselinux-2.0.24/src/matchpathcon.c ---- nsalibselinux/src/matchpathcon.c 2007-07-16 14:20:46.000000000 -0400 -+++ libselinux-2.0.24/src/matchpathcon.c 2007-07-23 10:21:34.000000000 -0400 -@@ -65,7 +65,7 @@ - #ifdef __GNUC__ - __attribute__ ((format(printf, 1, 2))) - #endif -- (*myprintf) (const char *fmt,...); -+ (*myprintf) (const char *fmt,...) = &default_printf; - - void set_matchpathcon_printf(void (*f) (const char *fmt, ...)) - { +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 --git a/libselinux.spec b/libselinux.spec index 4da7b70..3b0e1ec 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -2,10 +2,11 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 2.0.31 -Release: 3%{?dist} +Release: 4%{?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 +* Thu Sep 6 2007 Dan Walsh - 2.0.31-4 +- Apply James Athway patch to fix rpm_execcon python binding + * Tue Aug 28 2007 Dan Walsh - 2.0.31-3 - Move libselinux.so back into main package, breaks procps