Changeset 17862 in vbox
- Timestamp:
- Mar 13, 2009 10:51:44 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/hardenedmain.cpp
r11725 r17862 22 22 #include <VBox/sup.h> 23 23 24 #ifdef RT_OS_DARWIN 25 extern "C" DECLEXPORT(int) issetugid(void) 26 { 27 return 0; 28 } 29 #endif 24 30 25 31 int main(int argc, char **argv, char **envp) -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r17632 r17862 106 106 } 107 107 108 #endif 108 #endif /* DEBUG && X11 && LINUX*/ 109 110 #if defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64) 111 # include <dlfcn.h> 112 # include <sys/mman.h> 113 # include <iprt/asm.h> 114 115 /** Really ugly hack to shut up a silly check in AppKit. */ 116 static void ShutUpAppKit(void) 117 { 118 /* 119 * Find issetguid() and make it always return 0 by modifying the code. 120 */ 121 void *addr = dlsym(RTLD_DEFAULT, "issetugid"); 122 int rc = mprotect((void *)((uintptr_t)addr & ~(uintptr_t)0xfff), 0x2000, PROT_WRITE|PROT_READ|PROT_EXEC); 123 if (!rc) 124 ASMAtomicWriteU32((volatile uint32_t *)addr, 0xccc3c031); /* xor eax, eax; ret; int3 */ 125 } 126 #endif /* DARWIN + AMD64 */ 109 127 110 128 static void QtMessageOutput (QtMsgType type, const char *msg) … … 201 219 { 202 220 LogFlowFuncEnter(); 221 # if defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64) 222 ShutUpAppKit(); 223 # endif 203 224 204 225 #ifdef Q_WS_WIN … … 464 485 extern "C" DECLEXPORT(void) TrustedError (const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va) 465 486 { 487 # if defined(RT_OS_DARWIN) && defined(RT_ARCH_AMD64) 488 ShutUpAppKit(); 489 # endif 490 466 491 /* 467 492 * Init the Qt application object. This is a bit hackish as we
Note:
See TracChangeset
for help on using the changeset viewer.