From 75c50e49886a7919b6da962982cf952b1b9d7c62 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 2 May 2006 17:09:39 +0000 Subject: [PATCH] - Add selinuxswig fixes --- libselinux-rhat.patch | 78 +++++++++++-------------------------------- libselinux.spec | 9 +++-- 2 files changed, 26 insertions(+), 61 deletions(-) diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 7d00b69..2c183ab 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,64 +1,24 @@ -diff --exclude-from=exclude -N -u -r nsalibselinux/man/man8/booleans.8 libselinux-1.30.1/man/man8/booleans.8 ---- nsalibselinux/man/man8/booleans.8 2004-11-02 11:44:38.000000000 -0500 -+++ libselinux-1.30.1/man/man8/booleans.8 2006-04-11 15:01:19.000000000 -0400 -@@ -17,17 +17,10 @@ - value. - - The policy defines a default value for each boolean, typically false. --These default values can be overridden at boot-time based on the --settings in the --.I /etc/selinux/SELINUXTYPE/booleans --file, where --SELINUXTYPE is the type of policy currently being run on the system as --defined in the --.I /etc/selinux/config --file. The -+These default values can be overridden. The - .B system-config-securitylevel - tool provides an interface for altering --the settings in this file. The -+the settings of booleans. The - .B load_policy(8) - program will preserve - current boolean settings upon a policy reload by default, or can -@@ -41,8 +34,11 @@ - .B setsebool(8) - utility or the - .B togglesebool --utility. These utilities only change the -+utility. These utilities change the - current boolean value and do not affect the boot-time settings. -+You can use -+.B setsebool -P -+to permanantly change the setting of a boolean. - - .SH AUTHOR - This manual page was written by Dan Walsh . -@@ -51,5 +47,3 @@ - .SH "SEE ALSO" - getsebool(8), setsebool(8), selinux(8), togglesebool(8) - --.SH FILES --/etc/selinux/SELINUXTYPE/booleans, /etc/selinux/config -diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-1.30.1/src/selinuxswig.i ---- nsalibselinux/src/selinuxswig.i 2006-01-04 10:37:35.000000000 -0500 -+++ libselinux-1.30.1/src/selinuxswig.i 2006-04-11 14:55:35.000000000 -0400 -@@ -29,8 +29,9 @@ +diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-1.30.3/src/selinuxswig.i +--- nsalibselinux/src/selinuxswig.i 2006-04-14 07:21:23.000000000 -0400 ++++ libselinux-1.30.3/src/selinuxswig.i 2006-05-02 13:08:05.000000000 -0400 +@@ -28,9 +28,18 @@ + %typemap(in, numinputs=0) security_context_t *(security_context_t temp) { $1 = &temp; } - %typemap(argout) security_context_t * { -- $result = t_output_helper($result, PyString_FromString(*$1)); -+ $result = SWIG_Python_AppendOutput($result, PyString_FromString(*$1)); +-%typemap(argout) security_context_t * { +- $result = SWIG_Python_AppendOutput($result, PyString_FromString(*$1)); ++%typemap(argout) security_context_t * (char *temp) { ++ if (*$1) ++ temp = *$1; ++ else ++ temp = ""; ++ $result = SWIG_Python_AppendOutput($result, PyString_FromString(temp)); ++} ++ ++%typemap(in) security_context_t { ++ $1 = (security_context_t)PyString_AsString($input); } -+%typedef unsigned mode_t; ++ + %typedef unsigned mode_t; extern int is_selinux_enabled(void); - extern int is_selinux_mls_enabled(void); -@@ -114,6 +115,6 @@ - } - - %typemap(argout) char ** { -- $result = t_output_helper($result, PyString_FromString(*$1)); -+ $result = SWIG_Python_AppendOutput($result, PyString_FromString(*$1)); - } - extern int getseuserbyname(const char *linuxuser, char **seuser, char **level); diff --git a/libselinux.spec b/libselinux.spec index d06a161..c166467 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -3,10 +3,11 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 1.30.3 -Release: 1 +Release: 2 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} Requires: libsepol >= %{libsepolver} @@ -50,6 +51,7 @@ needed for developing SELinux applications. %prep %setup -q +%patch -p1 -b .rhat %build make clean @@ -109,6 +111,9 @@ exit 0 %{_libdir}/python*/site-packages/selinux.py* %changelog +* Tue May 2 2006 Dan Walsh 1.30.3-2 +- Add selinuxswig fixes + * Fri Apr 14 2006 Dan Walsh 1.30.3-1 - Upgrade to latest from NSA * Added distclean target to Makefile. @@ -117,7 +122,7 @@ exit 0 a regular file. * Merged python binding t_output_helper removal patch from Dan Walsh. -* Mon Mar 27 2006 Dan Walsh 1.30.1-2 +* Mon Apr 11 2006 Dan Walsh 1.30.1-2 - Fix python bindings for matchpathcon - Fix booleans man page