Changeset 57747 in vbox
- Timestamp:
- Sep 14, 2015 6:31:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r57501 r57747 165 165 #endif /* DEBUG && X11 && LINUX*/ 166 166 167 #if defined(RT_OS_DARWIN)167 #ifdef Q_WS_MAC 168 168 # include <dlfcn.h> 169 169 # include <sys/mman.h> … … 171 171 # include <iprt/system.h> 172 172 173 /** Really ugly hack to shut up asilly check in AppKit. */174 static void ShutUpAppKit(void)173 /** Mac OS X: Really ugly hack to prevent silly check in AppKit. */ 174 static void PreventCheckInAppKit() 175 175 { 176 /* Check for Snow Leopard or higher */176 /* Check for Snow Leopard or higher: */ 177 177 char szInfo[64]; 178 int rc = RTSystemQueryOSInfo (RTSYSOSINFO_RELEASE, szInfo, sizeof(szInfo)); 179 if ( RT_SUCCESS (rc) 180 && szInfo[0] == '1') /* higher than 1x.x.x */ 178 int rc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szInfo, sizeof(szInfo)); 179 if (RT_SUCCESS(rc) && szInfo[0] == '1') /* higher than 1x.x.x */ 181 180 { 182 /* 183 * Find issetguid() and make it always return 0 by modifying the code. 184 */ 185 void *addr = dlsym(RTLD_DEFAULT, "issetugid"); 186 int rc = mprotect((void *)((uintptr_t)addr & ~(uintptr_t)0xfff), 0x2000, PROT_WRITE|PROT_READ|PROT_EXEC); 181 /* Find issetguid() and make it always return 0 by modifying the code: */ 182 void *pAddr = dlsym(RTLD_DEFAULT, "issetugid"); 183 int rc = mprotect((void *)((uintptr_t)pAddr & ~(uintptr_t)0xfff), 0x2000, PROT_WRITE|PROT_READ|PROT_EXEC); 187 184 if (!rc) 188 ASMAtomicWriteU32((volatile uint32_t *) addr, 0xccc3c031); /* xor eax, eax; ret; int3 */185 ASMAtomicWriteU32((volatile uint32_t *)pAddr, 0xccc3c031); /* xor eax, eax; ret; int3 */ 189 186 } 190 187 } 191 #endif /* DARWIN*/188 #endif /* Q_WS_MAC */ 192 189 193 190 static void QtMessageOutput (QtMsgType type, const char *msg) … … 312 309 do 313 310 { 314 #ifdef RT_OS_DARWIN315 ShutUpAppKit();316 #endif /* RT_OS_DARWIN*/311 #ifdef Q_WS_MAC 312 PreventCheckInAppKit(); 313 #endif /* Q_WS_MAC */ 317 314 318 315 /* Console help preprocessing: */ … … 640 637 extern "C" DECLEXPORT(void) TrustedError(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va) 641 638 { 642 # ifdef RT_OS_DARWIN 643 ShutUpAppKit(); 644 # endif /* RT_OS_DARWIN */ 639 # ifdef Q_WS_MAC 640 PreventCheckInAppKit(); 641 # endif /* Q_WS_MAC */ 642 645 643 char szMsgBuf[_16K]; 646 644
Note:
See TracChangeset
for help on using the changeset viewer.