- Fix semanage segfault on x86 platform

This commit is contained in:
Daniel J Walsh 2007-06-26 09:16:06 +00:00
parent 029d48694c
commit 3e1ba6da3a
4 changed files with 18 additions and 41 deletions

View File

@ -122,3 +122,4 @@ libselinux-2.0.16.tgz
libselinux-2.0.18.tgz libselinux-2.0.18.tgz
libselinux-2.0.21.tgz libselinux-2.0.21.tgz
libselinux-2.0.22.tgz libselinux-2.0.22.tgz
libselinux-2.0.23.tgz

View File

@ -1,40 +1,13 @@
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-2.0.15/src/selinuxswig.i diff --exclude-from=exclude -N -u -r nsalibselinux/Makefile libselinux-2.0.23/Makefile
--- nsalibselinux/src/selinuxswig.i 2007-05-18 09:58:34.000000000 -0400 --- nsalibselinux/Makefile 2007-06-01 10:44:08.000000000 -0400
+++ libselinux-2.0.15/src/selinuxswig.i 2007-05-15 15:07:02.000000000 -0400 +++ libselinux-2.0.23/Makefile 2007-06-26 05:11:37.000000000 -0400
@@ -41,6 +40,36 @@ @@ -20,6 +20,9 @@
$1 = (security_context_t)PyString_AsString($input); $(MAKE) -C src
} $(MAKE) -C utils
+%typemap(python,argout) security_context_t ** { +swigify:
+ int i; + $(MAKE) -C src swigify
+ PyObject *security_context_string;
+ +
+ PyObject *list_security_context = PyList_New(0); // Create the list. pywrap:
+ if (list_security_context) { $(MAKE) -C src pywrap
+ security_context_t *p_security_context_t = *arg3;
+ for (i=0; i < result; i++) {
+ security_context_string = PyString_FromString(strdup((char *)p_security_context_t[i]));
+ if (PyList_Append(list_security_context, security_context_string) < 0) {
+ PyErr_SetString(PyExc_MemoryError,"typemap(argout) security_context_t **: Fail to insert item in list.");
+ Py_DECREF(list_security_context);
+ $result = SWIG_From_int(STATUS_ERR);
+ break;
+ }
+ }
+ freeconary(p_security_context_t);
+ }
+ else {
+ PyErr_SetString(PyExc_MemoryError,"typemap(argout) security_context_t **: Fail to create list.");
+ $result = SWIG_From_int(STATUS_ERR);
+ }
+
+ %append_output(list_security_context);
+}
+
+%typemap(in, numinputs=0) security_context_t **(security_context_t *temp=NULL) {
+ $1 = &temp;
+}
+
%typedef unsigned mode_t;
%include "../include/selinux/get_context_list.h"

View File

@ -1,13 +1,12 @@
%define libsepolver 2.0.1-1 %define libsepolver 2.0.1-1
Summary: SELinux library and simple utilities Summary: SELinux library and simple utilities
Name: libselinux Name: libselinux
Version: 2.0.22 Version: 2.0.23
Release: 1%{?dist} Release: 1%{?dist}
License: Public domain (uncopyrighted) License: Public domain (uncopyrighted)
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
Patch: libselinux-rhat.patch Patch: libselinux-rhat.patch
Patch1: libselinux_swig_with_raw.patch
BuildRequires: libsepol-devel >= %{libsepolver} swig BuildRequires: libsepol-devel >= %{libsepolver} swig
Requires: libsepol >= %{libsepolver} setransd Requires: libsepol >= %{libsepolver} setransd
@ -50,10 +49,11 @@ needed for developing SELinux applications.
%prep %prep
%setup -q %setup -q
%patch1 -p1 -b .swig %patch -p1 -b .rhat
%build %build
make clean make clean
make CFLAGS="-g %{optflags}" swigify
make CFLAGS="-g %{optflags}" all pywrap make CFLAGS="-g %{optflags}" all pywrap
%install %install
@ -123,6 +123,9 @@ exit 0
%{_libdir}/python*/site-packages/selinux.py* %{_libdir}/python*/site-packages/selinux.py*
%changelog %changelog
* Tue Jun 26 2007 Dan Walsh <dwalsh@redhat.com> - 2.0.23-1
- Fix semanage segfault on x86 platform
* Thu Jun 21 2007 Dan Walsh <dwalsh@redhat.com> - 2.0.22-1 * Thu Jun 21 2007 Dan Walsh <dwalsh@redhat.com> - 2.0.22-1
- Upgrade to upstream - Upgrade to upstream
* Labeling and callback interface patches from Eamon Walsh. * Labeling and callback interface patches from Eamon Walsh.

View File

@ -1 +1 @@
dfc0f36fecae27d5fbe71aeb6350039d libselinux-2.0.22.tgz 36d94149e3d10a593edf8289f725624a libselinux-2.0.23.tgz