rpms/python/devel python-2.6-ctypes-noexecmem.patch, NONE, 1.1 python.spec, 1.144, 1.145

James Antill james at fedoraproject.org
Tue Mar 17 15:18:49 UTC 2009


Author: james

Update of /cvs/pkgs/rpms/python/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20276

Modified Files:
	python.spec 
Added Files:
	python-2.6-ctypes-noexecmem.patch 
Log Message:
* Tue Mar 17 2009 James Antill <james at fedoraproject.org> - 2.6-7
- Use system libffi
- Resolves: bug#490573
- Fix SELinux execmem problems
- Resolves: bug#488396


python-2.6-ctypes-noexecmem.patch:

--- NEW FILE python-2.6-ctypes-noexecmem.patch ---
diff -ur Python-2.6~/Modules/_ctypes/callbacks.c Python-2.6/Modules/_ctypes/callbacks.c
--- Python-2.6~/Modules/_ctypes/callbacks.c	2008-06-09 00:58:54.000000000 -0400
+++ Python-2.6/Modules/_ctypes/callbacks.c	2009-03-17 00:08:38.424528546 -0400
@@ -21,8 +21,8 @@
 	Py_XDECREF(self->converters);
 	Py_XDECREF(self->callable);
 	Py_XDECREF(self->restype);
-	if (self->pcl)
-		FreeClosure(self->pcl);
+	if (self->pcl_write)
+		ffi_closure_free(self->pcl_write);
 	PyObject_Del(self);
 }
 
@@ -373,7 +373,8 @@
 		return NULL;
 	}
 
-	p->pcl = NULL;
+	p->pcl_exec = NULL;
+	p->pcl_write = NULL;
 	memset(&p->cif, 0, sizeof(p->cif));
 	p->converters = NULL;
 	p->callable = NULL;
@@ -402,8 +403,9 @@
 
 	assert(CThunk_CheckExact(p));
 
-	p->pcl = MallocClosure();
-	if (p->pcl == NULL) {
+	p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
+					 &p->pcl_exec);
+	if (p->pcl_write == NULL) {
 		PyErr_NoMemory();
 		goto error;
 	}
@@ -448,7 +450,9 @@
 			     "ffi_prep_cif failed with %d", result);
 		goto error;
 	}
-	result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
+	result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
+				      p,
+				      p->pcl_exec);
 	if (result != FFI_OK) {
 		PyErr_Format(PyExc_RuntimeError,
 			     "ffi_prep_closure failed with %d", result);
diff -ur Python-2.6~/Modules/_ctypes/_ctypes.c Python-2.6/Modules/_ctypes/_ctypes.c
--- Python-2.6~/Modules/_ctypes/_ctypes.c	2008-08-19 15:40:23.000000000 -0400
+++ Python-2.6/Modules/_ctypes/_ctypes.c	2009-03-17 00:08:38.479530502 -0400
@@ -3438,7 +3438,7 @@
 	self->callable = callable;
 
 	self->thunk = thunk;
-	*(void **)self->b_ptr = (void *)thunk->pcl;
+	*(void **)self->b_ptr = (void *)thunk->pcl_exec;
 	
 	Py_INCREF((PyObject *)thunk); /* for KeepRef */
 	if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
diff -ur Python-2.6~/Modules/_ctypes/ctypes.h Python-2.6/Modules/_ctypes/ctypes.h
--- Python-2.6~/Modules/_ctypes/ctypes.h	2008-07-24 07:16:45.000000000 -0400
+++ Python-2.6/Modules/_ctypes/ctypes.h	2009-03-17 00:08:38.480528344 -0400
@@ -95,7 +95,8 @@
 
 typedef struct {
 	PyObject_VAR_HEAD
-	ffi_closure *pcl; /* the C callable */
+	ffi_closure *pcl_write; /* the C callable, writeable */
+	void *pcl_exec;         /* the C callable, executable */
 	ffi_cif cif;
 	int flags;
 	PyObject *converters;
diff -ur Python-2.6~/setup.py Python-2.6/setup.py
--- Python-2.6~/setup.py	2009-03-17 00:07:54.771651851 -0400
+++ Python-2.6/setup.py	2009-03-17 00:08:19.792558478 -0400
@@ -1701,8 +1701,7 @@
                    '_ctypes/callbacks.c',
                    '_ctypes/callproc.c',
                    '_ctypes/stgdict.c',
-                   '_ctypes/cfield.c',
-                   '_ctypes/malloc_closure.c']
+                   '_ctypes/cfield.c']
         depends = ['_ctypes/ctypes.h']
 
         if sys.platform == 'darwin':


Index: python.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python/devel/python.spec,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -r1.144 -r1.145
--- python.spec	17 Mar 2009 14:05:09 -0000	1.144
+++ python.spec	17 Mar 2009 15:18:18 -0000	1.145
@@ -22,7 +22,7 @@
 Summary: An interpreted, interactive, object-oriented programming language
 Name: %{python}
 Version: 2.6
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: Python
 Group: Development/Languages
 Provides: python-abi = %{pybasever}
@@ -61,6 +61,9 @@
 Patch101: python-2.3.4-lib64-regex.patch
 Patch102: python-2.6-lib64.patch
 
+# SELinux patches
+Patch110: python-2.6-lib64.patch
+
 # New API from 2.6
 #Patch260: python-2.5.2-set_wakeup_fd4.patch
 
@@ -227,6 +230,8 @@
 %patch101 -p1 -b .lib64-regex
 %endif
 
+%patch110 -p1 -b .selinux
+
 #%%patch260 -p1 -b .set_wakeup_fd
 
 #%%patch999 -p1 -b .cve2007-4965
@@ -526,9 +531,11 @@
 %{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
 
 %changelog
-* Tue Mar 17 2009 James Antill <james at fedoraproject.org> - 2.6-6
+* Tue Mar 17 2009 James Antill <james at fedoraproject.org> - 2.6-7
 - Use system libffi
 - Resolves: bug#490573
+- Fix SELinux execmem problems
+- Resolves: bug#488396
 
 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.6-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild




More information about the fedora-extras-commits mailing list