rpms/openoffice.org/devel openoffice.org-2.0.3.ooo97320.selinux.bridges.patch, NONE, 1.1 openoffice.org.spec, 1.1724, 1.1725 openoffice.org-2.0.3.ooo80816.selinux.bridges.patch, 1.8, NONE

Caolan McNamara caolanm at fedoraproject.org
Tue Dec 16 17:02:06 UTC 2008


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30369

Modified Files:
	openoffice.org.spec 
Added Files:
	openoffice.org-2.0.3.ooo97320.selinux.bridges.patch 
Removed Files:
	openoffice.org-2.0.3.ooo80816.selinux.bridges.patch 
Log Message:
resubmit selinux stuff to try and get a bit of traction on it

openoffice.org-2.0.3.ooo97320.selinux.bridges.patch:

--- NEW FILE openoffice.org-2.0.3.ooo97320.selinux.bridges.patch ---
Index: inc/bridges/cpp_uno/shared/vtablefactory.hxx
===================================================================
RCS file: /cvs/udk/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx,v
retrieving revision 1.5
diff -u -r1.5 vtablefactory.hxx
--- openoffice.org.orig/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx	2 May 2006 11:59:11 -0000	1.5
+++ openoffice.org/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx	17 May 2006 10:57:45 -0000
@@ -66,11 +66,21 @@
             skipping an RTTI pointer, see mapBlockToVtable).  Also, the block
             contains any generated code snippets, after the vtable itself.
          */
-        void * start;
+	int fd;
+        void * writep;
+        void * execp;
+	int * ref;
 
         /** The size of the raw vtable block, in bytes.
          */
         sal_Size size;
+	Block(sal_Size nSize);
+	Block(const Block &rOther);
+	~Block();
+	Block();
+	Block& operator=(const Block& rOther);
+	void swapwriteandexec();
+	void release();
     };
 
     /** The vtable structure corresponding to an interface type.
@@ -116,8 +126,6 @@
     VtableFactory(VtableFactory &); // not implemented
     void operator =(VtableFactory); // not implemented
 
-    void freeBlock(Block const & block) const;
-
     void createVtables(
         GuardedBlocks & blocks, BaseOffset const & baseOffset,
         typelib_InterfaceTypeDescription * type, bool includePrimary) const;
@@ -169,7 +177,7 @@
         @return  a pointer to the remaining code snippet area
      */
     static unsigned char * addLocalFunctions(
-        Slot ** slots, unsigned char * code,
+        Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
         typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
         sal_Int32 functionCount, sal_Int32 vtableOffset);
 
@@ -188,8 +196,6 @@
 
     osl::Mutex m_mutex;
     Map m_map;
-
-    rtl_arena_type * m_arena;
 };
 
 } } }
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.10
diff -u -r1.10 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx	2 May 2006 12:01:33 -0000	1.10
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx	17 May 2006 10:57:47 -0000
@@ -367,7 +367,7 @@
 int const codeSnippetSize = 16;
 
 unsigned char * codeSnippet(
-    unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset,
+    unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 functionIndex, sal_Int32 vtableOffset,
     typelib_TypeClass returnTypeClass)
 {
     if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass)) {
@@ -413,7 +413,7 @@
     // jmp privateSnippetExecutor:
     *p++ = 0xE9;
     *reinterpret_cast< sal_Int32 * >(p)
-        = ((unsigned char *) exec) - p - sizeof (sal_Int32);
+        = ((unsigned char *) exec) - p - sizeof (sal_Int32) - writetoexecdiff;
     p += sizeof (sal_Int32);
     OSL_ASSERT(p - code <= codeSnippetSize);
     return code + codeSnippetSize;
@@ -445,7 +445,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -458,9 +458,9 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, writetoexecdiff, functionOffset++, vtableOffset,
                 reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
                     member)->pAttributeTypeRef->eTypeClass);
             // Setter:
@@ -468,17 +468,17 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
                 code = codeSnippet(
-                    code, functionOffset++, vtableOffset,
+                    code, writetoexecdiff, functionOffset++, vtableOffset,
                     typelib_TypeClass_VOID);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, writetoexecdiff, functionOffset++, vtableOffset,
                 reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
                     member)->pReturnTypeRef->eTypeClass);
             break;
Index: source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx,v
retrieving revision 1.8
diff -u -r1.8 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx	2 May 2006 12:02:15 -0000	1.8
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx	17 May 2006 10:57:47 -0000
@@ -685,7 +685,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -702,9 +702,9 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
                     reinterpret_cast<
                     typelib_InterfaceAttributeTypeDescription * >(
@@ -715,15 +715,15 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
-                code = codeSnippet(code, functionOffset++, vtableOffset, true);
+                (s++)->fn = code + writetoexecdiff;
+                code = codeSnippet(code, functionOffset++, vtableOffset, true);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
                     reinterpret_cast<
                     typelib_InterfaceMethodTypeDescription * >(
Index: source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx,v
retrieving revision 1.5
diff -u -r1.5 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx	2 May 2006 12:03:36 -0000	1.5
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx	17 May 2006 10:57:48 -0000
@@ -494,7 +494,7 @@
 //==================================================================================================
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-	Slot ** slots, unsigned char * code,
+	Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
 	typelib_InterfaceTypeDescription const * type, sal_Int32 nFunctionOffset,
 	sal_Int32 functionCount, sal_Int32 nVtableOffset )
 {
@@ -513,15 +513,15 @@
 				reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( pTD );
 
 			// get method
-			(s++)->fn = code;
-			code = codeSnippet( code, nFunctionOffset++, nVtableOffset,
+			(s++)->fn = code + writetoexecdiff;
+			code = codeSnippet( code, nFunctionOffset++, nVtableOffset,
 								x86_64::return_in_hidden_param( pAttrTD->pAttributeTypeRef ) );
 
 			if ( ! pAttrTD->bReadOnly )
 			{
 				// set method
-				(s++)->fn = code;
-				code = codeSnippet( code, nFunctionOffset++, nVtableOffset, false );
+				(s++)->fn = code + writetoexecdiff;
+				code = codeSnippet( code, nFunctionOffset++, nVtableOffset, false );
 			}
 		}
 		else if ( typelib_TypeClass_INTERFACE_METHOD == pTD->eTypeClass )
@@ -529,8 +529,8 @@
 			typelib_InterfaceMethodTypeDescription *pMethodTD =
 				reinterpret_cast<typelib_InterfaceMethodTypeDescription *>( pTD );
 			
-			(s++)->fn = code;
-			code = codeSnippet( code, nFunctionOffset++, nVtableOffset,
+			(s++)->fn = code + writetoexecdiff;
+			code = codeSnippet( code, nFunctionOffset++, nVtableOffset,
 								x86_64::return_in_hidden_param( pMethodTD->pReturnTypeRef ) );
 		}
 		else
Index: source/cpp_uno/shared/cppinterfaceproxy.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx,v
retrieving revision 1.4
diff -u -r1.4 cppinterfaceproxy.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx	2 May 2006 12:07:01 -0000	1.4
+++ openoffice.org/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx	17 May 2006 10:57:48 -0000
@@ -89,7 +89,7 @@
         pMemory.release());
     for (sal_Int32 i = 0; i < aVtables.count; ++i) {
         pProxy->vtables[i] = VtableFactory::mapBlockToVtable(
-            aVtables.blocks[i].start);
+            aVtables.blocks[i].writep);
     }
     return castProxyToInterface(pProxy);
 }
Index: source/cpp_uno/shared/vtablefactory.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/shared/vtablefactory.cxx,v
retrieving revision 1.5
diff -u -r1.5 vtablefactory.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/shared/vtablefactory.cxx	2 May 2006 12:07:18 -0000	1.5
+++ openoffice.org/bridges/source/cpp_uno/shared/vtablefactory.cxx	17 May 2006 10:57:48 -0000
@@ -49,6 +49,9 @@
 
 #include "osl/diagnose.h"
 #include "osl/mutex.hxx"
+#include "osl/thread.h"
+#include "osl/security.hxx"
+#include "osl/file.hxx"
 #include "rtl/alloc.h"
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
@@ -61,6 +64,8 @@
 #if defined SAL_UNX
 #include <unistd.h>
 #include <sys/mman.h>
+#include <stdio.h>
+#include <string.h>
 #elif defined SAL_W32
 #define WIN32_LEAN_AND_MEAN
 #ifdef _MSC_VER
@@ -80,9 +85,12 @@
 
 using bridges::cpp_uno::shared::VtableFactory;
 
-namespace {
+VtableFactory::Block::Block() : fd(-1), writep(0), execp(0), ref(0), size(0)
+{
+}
 
-extern "C" void * SAL_CALL allocExec(rtl_arena_type *, sal_Size * size) {
+VtableFactory::Block::Block(sal_Size nSize) : fd(-1), writep(0), execp(0), ref(0), size(0)
+{
     sal_Size pagesize;
 #if defined SAL_UNX
 #if defined FREEBSD || defined NETBSD
@@ -101,45 +109,118 @@
 #else
 #error Unsupported platform
 #endif
-    sal_Size n = (*size + (pagesize - 1)) & ~(pagesize - 1);
-    void * p;
+    sal_Size n = (nSize + (pagesize - 1)) & ~(pagesize - 1);
 #if defined SAL_UNX
-    p = mmap(
-        0, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1,
-        0);
-    if (p == MAP_FAILED) {
-        p = 0;
-    }
-	else if (mprotect (static_cast<char*>(p), n, PROT_READ | PROT_WRITE | PROT_EXEC) == -1)
-	{
-		munmap (static_cast<char*>(p), n);
-		p = 0;
-	}
+    osl::Security aSecurity;
+    rtl::OUString strDirectory;
+    rtl::OUString strURLDirectory;
+    if (aSecurity.getHomeDir(strURLDirectory))
+        osl::File::getSystemPathFromFileURL(strURLDirectory, strDirectory);
+
+    for (int i = strDirectory.getLength() == 0 ? 1 : 0; i < 2; ++i)
+    {
+        if (!strDirectory.getLength())
+            strDirectory = rtl::OUString::createFromAscii("/tmp");
+
+        strDirectory += rtl::OUString::createFromAscii("/.execoooXXXXXX");
+        rtl::OString aTmpName = rtl::OUStringToOString(strDirectory, osl_getThreadTextEncoding());
+        char *tmpfname = new char[aTmpName.getLength()+1];
+        strncpy(tmpfname, aTmpName.getStr(), aTmpName.getLength()+1);
+        if ((fd = mkstemp(tmpfname)) == -1)
+          perror("creation of executable memory area failed");
+        if (fd == -1)
+        {
+            delete[] tmpfname;
+            break;
+        }
+        unlink(tmpfname);
+        delete[] tmpfname;
+        ftruncate(fd, nSize);
+        writep = mmap(NULL, n, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+        if (writep == MAP_FAILED) {
+            writep = 0;
+        }
+        execp = mmap(NULL, n, PROT_READ | PROT_EXEC, MAP_SHARED, fd, 0);
+        if (execp == MAP_FAILED) {
+           execp = 0;
+        }
+
+    	if (writep && execp && fd != -1)
+            break;
+
+        if (writep) munmap(writep, size);
+	writep = 0;
+        if (execp) munmap(execp, size);
+	execp = 0;
+        if (fd != -1) close(fd);
+	fd = -1;
+        strDirectory = rtl::OUString();
+    }
 #elif defined SAL_W32
     p = VirtualAlloc(0, n, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
 #elif defined(SAL_OS2)
     p = 0;
     DosAllocMem( &p, n, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_ANY);
 #endif
-    if (p != 0) {
-        *size = n;
+    if (writep || execp || fd != -1) {
+        size = n;
+      ref = new int(1);
+    }
+    if (!writep || !execp || fd == -1)
+    {
+	fprintf(stderr, "FATAL ERROR, could not mmap a file for executable memory either in home dir or in /tmp\n");
+	fprintf(stderr, "Cannot continue, perhaps examine your mount options for those directories, or selinux\n");
+	exit(-1);
     }
-    return p;
 }
 
-extern "C" void SAL_CALL freeExec(
-    rtl_arena_type *, void * address, sal_Size size)
+void VtableFactory::Block::release()
 {
+    if (ref)
+    {
+        (*ref)--;
+        if (*ref == 0)
+        {
 #if defined SAL_UNX
-    munmap(static_cast< char * >(address), size);
+            if (writep) munmap(writep, size);
+            if (execp) munmap(execp, size);
+            if (fd != -1) close(fd);
 #elif defined SAL_W32
-    (void) size; // unused
-    VirtualFree(address, 0, MEM_RELEASE);
+    		(void) size; // unused
+		    VirtualFree(address, 0, MEM_RELEASE);
 #elif defined(SAL_OS2)
-	(void) DosFreeMem( address);
+			(void) DosFreeMem( address);
 #endif
+			delete ref;
+        }
+    }
 }
 
+VtableFactory::Block::~Block()
+{
+    release();
+}
+
+VtableFactory::Block::Block(const Block& rOther) : fd(rOther.fd), writep(rOther.writep), execp(rOther.execp), ref(rOther.ref), size(rOther.size)
+{
+    if (ref) (*ref)++;
+}
+
+VtableFactory::Block& VtableFactory::Block::operator=(const VtableFactory::Block& rOther)
+{
+    release();
+    fd = rOther.fd;
+    writep = rOther.writep;
+    execp = rOther.execp;
+    size = rOther.size;
+    ref = rOther.ref;
+    if (ref) (*ref)++;
+    return *this;
+}
+
+void VtableFactory::Block::swapwriteandexec()
+{
+    ::std::swap(writep, execp);
 }
 
 class VtableFactory::GuardedBlocks: public std::vector< Block > {
@@ -160,11 +241,6 @@
 };
 
 VtableFactory::GuardedBlocks::~GuardedBlocks() {
-    if (m_guarded) {
-        for (iterator i(begin()); i != end(); ++i) {
-            m_factory.freeBlock(*i);
-        }
-    }
 }
 
 class VtableFactory::BaseOffset {
@@ -199,28 +275,17 @@
     return offset;
 }
 
-VtableFactory::VtableFactory(): m_arena(
-    rtl_arena_create(
-        "bridges::cpp_uno::shared::VtableFactory",
-        sizeof (void *), // to satisfy alignment requirements
-        0, reinterpret_cast< rtl_arena_type * >(-1), allocExec, freeExec, 0))
+VtableFactory::VtableFactory()
 {
-    if (m_arena == 0) {
-        throw std::bad_alloc();
-    }
 }
 
 VtableFactory::~VtableFactory() {
     {
         osl::MutexGuard guard(m_mutex);
         for (Map::iterator i(m_map.begin()); i != m_map.end(); ++i) {
-            for (sal_Int32 j = 0; j < i->second.count; ++j) {
-                freeBlock(i->second.blocks[j]);
-            }
             delete[] i->second.blocks;
         }
     }
-    rtl_arena_destroy(m_arena);
 }
 
 VtableFactory::Vtables VtableFactory::getVtables(
@@ -248,10 +313,6 @@
     return i->second;
 }
 
-void VtableFactory::freeBlock(Block const & block) const {
-    rtl_arena_free(m_arena, block.start, block.size);
-}
-
 void VtableFactory::createVtables(
     GuardedBlocks & blocks, BaseOffset const & baseOffset,
     typelib_InterfaceTypeDescription * type, bool includePrimary) const
@@ -259,31 +320,30 @@
     if (includePrimary) {
         sal_Int32 slotCount
             = bridges::cpp_uno::shared::getPrimaryFunctions(type);
-        Block block;
-        block.size = getBlockSize(slotCount);
-        block.start = rtl_arena_alloc(m_arena, &block.size);
-        if (block.start == 0) {
+        Block block(getBlockSize(slotCount));
+        if (block.writep == 0 || block.execp == 0) {
             throw std::bad_alloc();
         }
         try {
-            Slot * slots = initializeBlock(block.start, slotCount);
+            Slot * slots = initializeBlock(block.writep, slotCount);
             unsigned char * codeBegin =
                 reinterpret_cast< unsigned char * >(slots);
             unsigned char * code = codeBegin;
+            sal_PtrDiff writetoexecdiff = sal_IntPtr(block.execp) - sal_IntPtr(block.writep);
             sal_Int32 vtableOffset = blocks.size() * sizeof (Slot *);
             for (typelib_InterfaceTypeDescription const * type2 = type;
                  type2 != 0; type2 = type2->pBaseTypeDescription)
             {
                 code = addLocalFunctions(
-                    &slots, code, type2,
+                    &slots, code, writetoexecdiff, type2,
                     baseOffset.getFunctionOffset(type2->aBase.pTypeName),
                     bridges::cpp_uno::shared::getLocalFunctions(type2),
                     vtableOffset);
             }
             flushCode(codeBegin, code);
+            block.swapwriteandexec();
             blocks.push_back(block);
         } catch (...) {
-            freeBlock(block);
             throw;
         }
     }
Index: source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx,v
retrieving revision 1.12
diff -u -r1.12 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx	22 Nov 2006 11:07:20 -0000	1.12
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx	5 Jun 2007 12:38:03 -0000
@@ -518,7 +518,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vTableOffset)
 {
@@ -531,9 +531,9 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vTableOffset,
+                code, functionOffset++, vTableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
                     reinterpret_cast<
 		    typelib_InterfaceAttributeTypeDescription * >(
@@ -543,15 +543,15 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
-                code = codeSnippet(code, functionOffset++, vTableOffset, true);
+                (s++)->fn = code + writetoexecdiff;
+                code = codeSnippet(code, functionOffset++, vTableOffset, true);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vTableOffset,
+                code, functionOffset++, vTableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
                     reinterpret_cast<
                     typelib_InterfaceMethodTypeDescription * >(
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx	2007-06-05 13:55:15.000000000 +0100
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx	2007-06-05 13:56:12.000000000 +0100
@@ -670,7 +670,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code, 
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -688,9 +688,9 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
                     reinterpret_cast<
                     typelib_InterfaceAttributeTypeDescription * >(
@@ -701,15 +701,15 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
-                code = codeSnippet(code, functionOffset++, vtableOffset, true);
+                (s++)->fn = code + writetoexecdiff;
+                code = codeSnippet(code, functionOffset++, vtableOffset, true);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
                     reinterpret_cast<
                     typelib_InterfaceMethodTypeDescription * >(
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx	2008-03-07 09:23:13.000000000 +0000
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx	2008-03-07 09:34:58.000000000 +0000
@@ -580,7 +580,7 @@
 {
 const int codeSnippetSize = 40;
 
-bridges::cpp_uno::shared::VtableFactory::Slot codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, 
+bridges::cpp_uno::shared::VtableFactory::Slot codeSnippet( unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, 
                               bool bHasHiddenParam )
 {
 #ifdef CMC_DEBUG
@@ -603,7 +603,7 @@
     raw[2] = nOffsetAndIndex;
     raw[3] = destination->gp_value;
 
-    return *(bridges::cpp_uno::shared::VtableFactory::Slot*)(code);
+    return *(bridges::cpp_uno::shared::VtableFactory::Slot*)(code+writetoexecdiff);
 }
 }
 
@@ -633,7 +633,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** in_slots, unsigned char * code,
+    Slot ** in_slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -652,7 +652,7 @@
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
             *slots++ = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, writetoexecdiff, functionOffset++, vtableOffset,
                 ia64::return_in_hidden_param(
                     reinterpret_cast<
                     typelib_InterfaceAttributeTypeDescription * >(
@@ -665,14 +665,14 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                *slots++ = codeSnippet(code, functionOffset++, vtableOffset, false);
+                *slots++ = codeSnippet(code, writetoexecdiff, functionOffset++, vtableOffset, false);
             	code += codeSnippetSize;
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
             *slots++ = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, writetoexecdiff, functionOffset++, vtableOffset,
                 ia64::return_in_hidden_param(
                     reinterpret_cast<
                     typelib_InterfaceMethodTypeDescription * >(
Index: source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx,v
retrieving revision 1.4
diff -u -r1.4 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx	27 Feb 2008 09:50:53 -0000	1.4
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx	28 Mar 2008 14:41:06 -0000
@@ -472,7 +472,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -487,7 +487,7 @@
         {
             case typelib_TypeClass_INTERFACE_ATTRIBUTE:
                 // Getter:
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
                 code = codeSnippet(
                     code, functionOffset++, vtableOffset,
                     bridges::cpp_uno::shared::isSimpleType(
@@ -499,14 +499,14 @@
                     typelib_InterfaceAttributeTypeDescription * >(
                         member)->bReadOnly)
                 {
-                    (s++)->fn = code;
+                    (s++)->fn = code + writetoexecdiff;
                     code = codeSnippet(
                         code, functionOffset++, vtableOffset, true);
                 }
                 break;
             case typelib_TypeClass_INTERFACE_METHOD:
             {
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
 
                 typelib_InterfaceMethodTypeDescription *pMethodTD = 
                     reinterpret_cast<
Index: source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx,v
retrieving revision 1.5
diff -u -r1.5 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx	18 Mar 2008 16:05:50 -0000	1.5
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx	28 Mar 2008 14:41:06 -0000
@@ -645,7 +645,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -663,7 +663,7 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
                 code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
@@ -676,13 +676,13 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
                 code = codeSnippet(code, functionOffset++, vtableOffset, true);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
                 code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
Index: source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx,v
retrieving revision 1.4
diff -u -r1.4 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx	27 Feb 2008 09:54:38 -0000	1.4
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx	28 Mar 2008 14:42:53 -0000
@@ -752,7 +754,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-	Slot ** slots, unsigned char * code,
+	Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
 	typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
 	sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -772,7 +774,7 @@
 	switch (member->eTypeClass) {
 	  case typelib_TypeClass_INTERFACE_ATTRIBUTE:
 		// Getter:
-		(s++)->fn = code;
+		(s++)->fn = code + writetoexecdiff;
 		code = codeSnippet(
 			code, functionOffset++, vtableOffset,
 			bridges::cpp_uno::shared::isSimpleType(
@@ -785,13 +787,13 @@
 			typelib_InterfaceAttributeTypeDescription * >(
 			  member)->bReadOnly)
 		{
-		  (s++)->fn = code;
+		  (s++)->fn = code + writetoexecdiff;
 		  code = codeSnippet(code, functionOffset++, vtableOffset, true);
 		}
 		break;
 
 	  case typelib_TypeClass_INTERFACE_METHOD:
-		(s++)->fn = code;
+		(s++)->fn = code + writetoexecdiff;
 		code = codeSnippet(
 			code, functionOffset++, vtableOffset,
 			bridges::cpp_uno::shared::isSimpleType(
Index: source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx,v
retrieving revision 1.2
diff -u -r1.2 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx	3 Apr 2008 16:47:43 -0000	1.2
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx	14 Apr 2008 10:27:08 -0000
@@ -601,7 +601,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code, 
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -619,7 +619,7 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
                 code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
@@ -632,13 +632,13 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
                 code = codeSnippet(code, functionOffset++, vtableOffset, true);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
                 code, functionOffset++, vtableOffset,
                 bridges::cpp_uno::shared::isSimpleType(
Index: source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
===================================================================
RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx,v
retrieving revision 1.2
diff -u -r1.2 cpp2uno.cxx
--- openoffice.org.orig/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx	30 Jun 2008 15:04:49 -0000	1.2
+++ openoffice.org/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx	6 Jul 2008 22:16:27 -0000
@@ -482,7 +481,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -497,20 +496,20 @@
         {
             case typelib_TypeClass_INTERFACE_ATTRIBUTE:
                 // Getter:
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
                 code = codeSnippet(code, functionOffset++, vtableOffset);
                 // Setter:
                 if (!reinterpret_cast<
                     typelib_InterfaceAttributeTypeDescription * >(
                         member)->bReadOnly)
                 {
-                    (s++)->fn = code;
+                    (s++)->fn = code + writetoexecdiff;
                     code = codeSnippet(code, functionOffset++, vtableOffset);
                 }
                 break;
             case typelib_TypeClass_INTERFACE_METHOD:
             {
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
 
                 typelib_InterfaceMethodTypeDescription *pMethodTD = 
                     reinterpret_cast<


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.1724
retrieving revision 1.1725
diff -u -r1.1724 -r1.1725
--- openoffice.org.spec	14 Dec 2008 15:01:46 -0000	1.1724
+++ openoffice.org.spec	16 Dec 2008 17:01:35 -0000	1.1725
@@ -88,7 +88,7 @@
 Patch15: openoffice.org-2.2.0.ooo68717.gstreamer.video.patch
 Patch16: openoffice.org-2.2.0.ooo63159.sal.dtype.patch
 Patch17: openoffice.org-2.2.0.ooo76393.sal.dynamicsection.patch
-Patch18: openoffice.org-2.0.3.ooo80816.selinux.bridges.patch
+Patch18: openoffice.org-2.0.3.ooo97320.selinux.bridges.patch
 Patch19: openoffice.org-2.2.1.ooo7065.sw.titlepagedialog.patch
 Patch20: workspace.impressfontsize.patch
 Patch21: workspace.impressfontsize.tar.gz
@@ -1359,7 +1359,7 @@
 %patch15 -p0 -b .ooo68717.gstreamer.video.patch
 %patch16 -p1 -b .ooo63159.sal.dtype.patch
 %patch17 -p1 -b .ooo76393.sal.dynamicsection.patch
-%patch18 -p1 -b .ooo80816.selinux.bridges.patch
+%patch18 -p1 -b .ooo97320.selinux.bridges.patch
 %patch19 -p1 -b .ooo7065.sw.titlepagedialog.patch
 %patch20 -p1 -b .workspace.impressfontsize.patch
 tar xzf %{PATCH21}


--- openoffice.org-2.0.3.ooo80816.selinux.bridges.patch DELETED ---




More information about the fedora-extras-commits mailing list