[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/openoffice.org/devel openoffice.org-1.9.120.rh158977.execshield.bridges.patch, NONE, 1.1 openoffice.org.spec, 1.343, 1.344



Author: caolanm

Update of /cvs/dist/rpms/openoffice.org/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv12268

Modified Files:
	openoffice.org.spec 
Added Files:
	openoffice.org-1.9.120.rh158977.execshield.bridges.patch 
Log Message:
set executable heap for bridges code

openoffice.org-1.9.120.rh158977.execshield.bridges.patch:
 bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx |   18 ++++++++++++++++--
 source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx         |    0 
 2 files changed, 16 insertions(+), 2 deletions(-)

--- NEW FILE openoffice.org-1.9.120.rh158977.execshield.bridges.patch ---
Index: source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx,v
retrieving revision 1.8
diff -u -p -u -r1.8 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx	17 Jun 2005 09:51:58 -0000	1.8
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx	23 Jul 2005 14:19:14 -0000
@@ -71,6 +71,12 @@
 
 #include "share.hxx"
 
+#include <sys/mman.h>
+#include <limits.h>    /* for PAGESIZE */
+#ifndef PAGESIZE
+#define PAGESIZE 4096
+#endif
+
 using namespace ::com::sun::star::uno;
 
 namespace
@@ -446,11 +452,19 @@ void ** bridges::cpp_uno::shared::Vtable
     return reinterpret_cast< void ** >(block) + 2;
 }
 
+static char *create_executable_block(size_t nSize)
+{
+    char * block = new char[nSize];
+    char *p = (char *)(((int) block + PAGESIZE-1) & ~(PAGESIZE-1));
+    mprotect(p, nSize, PROT_READ | PROT_WRITE | PROT_EXEC);
+    return block;
+}
+
 char * bridges::cpp_uno::shared::VtableFactory::createBlock(
     sal_Int32 slotCount, void *** slots)
 {
-    char * block = new char[
-        (slotCount + 2) * sizeof (void *) + slotCount * codeSnippetSize];
+    size_t nSize = (slotCount + 2) * sizeof(void *) + slotCount * codeSnippetSize;
+    char * block = create_executable_block(nSize);
     *slots = mapBlockToVtable(block);
     (*slots)[-2] = 0;
     (*slots)[-1] = 0;


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.343
retrieving revision 1.344
diff -u -r1.343 -r1.344
--- openoffice.org.spec	23 Jul 2005 11:25:02 -0000	1.343
+++ openoffice.org.spec	23 Jul 2005 14:40:07 -0000	1.344
@@ -1,5 +1,5 @@
 %define ooo2ver 120
-%define ooo_rpm_release 2
+%define ooo_rpm_release 3
 %define build_fc4 0
 %define build_fc5 1
 
@@ -163,6 +163,7 @@
 Patch61: openoffice.org-1.9.117.oooXXXXX.mozillanspr.extensions.patch
 Patch62: openoffice.org-1.9.118.forwarddecl.psprint.patch
 Patch63: openoffice.org-1.9.118.rhXXXXX.envcflags.solenv.patch
+Patch64: openoffice.org-1.9.120.rh158977.execshield.bridges.patch
 
 %define instdir %{_libdir}/openoffice.org2.0
 
@@ -811,6 +812,7 @@
 %patch61 -p1 -b .oooXXXXX.mozillanspr.extensions.patch
 %patch62 -p1 -b .forwarddecl.psprint.patch
 # %patch63 -p1 -b .rhXXXXX.envcflags.solenv.patch
+%patch64 -p1 -b .rh158977.execshield.bridges.patch
 
 %if %{includeexternals}
 #start ludicrous workaround
@@ -818,14 +820,14 @@
 #libxmlsec/db4 then this needs to be modified/dropped
 find_provides="%{__find_provides}"
 echo "#!/bin/sh" > find-provides
-echo "$find_provides | grep -v libxmlsec1 | grep -v libdb- | grep -v libdb_" >> find-provides
+echo "$find_provides | grep -v libxmlsec1 | grep -v libdb- " >> find-provides
 echo "exit 0" >> find-provides
 chmod +x find-provides
 %define __find_provides %{_builddir}/SRC680_m%{ooo2ver}/find-provides
 
 find_requires="%{__find_requires}"
 echo "#!/bin/sh" > find-requires
-echo "$find_requires | grep -v libxmlsec1 | grep -v libdb- | grep -v libdb_ | grep -v \(" >> find-requires
+echo "$find_requires | grep -v libxmlsec1 | grep -v libdb- | grep -v \(" >> find-requires
 echo "exit 0" >> find-requires
 chmod +x find-requires
 %define __find_requires %{_builddir}/SRC680_m%{ooo2ver}/find-requires
@@ -914,7 +916,7 @@
 
 %install
 #rh#158977# clear execstack requirement
-#execstack -c $RPM_BUILD_ROOT/%{instdir}/program/libgcc3_uno.so
+execstack -c $RPM_BUILD_ROOT/%{instdir}/program/libgcc3_uno.so
 
 # We don't need to carry around all the letter templates for all the languages 
 # in each langpack! In addition, all the bitmaps are the same!
@@ -963,10 +965,9 @@
         fi
 
 done
-#disabled for now until system-db is done
 if [ $origin == 1 ]; then false; fi
 #if [ $pic == 1 ]; then false; fi
-#if [ $executable == 1 ]; then false; fi
+if [ $executable == 1 ]; then false; fi
 
 #make up some /usr/bin scripts
 cp %{SOURCE4} $RPM_BUILD_ROOT/%{instdir}/program/crash_report
@@ -3015,6 +3016,9 @@
 %{instdir}/share/registry/modules/org/openoffice/Office/Scripting/Scripting-python.xcu
 
 %changelog
+* Sat Jul 23 2005 Caolan McNamara <caolanm redhat com> - 1:1.9.120-3
+- add openoffice.org-1.9.120.rh158977.execshield.bridges.patch
+
 * Sat Jul 23 2005 Caolan McNamara <caolanm redhat com> - 1:1.9.120-2
 - try and reenable ppc building
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]