Changeset 83033 in vbox
- Timestamp:
- Feb 10, 2020 1:40:54 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136055
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r82997 r83033 6758 6758 endif # not darwin, os2 or win 6759 6759 6760 ifeq ($(KBUILD_TARGET),darwin) 6761 TEMPLATE_VBOXQTGUIEXE_POST_CMDS = $(QUIET)install_name_tool $(foreach qtmod, $(VBOX_QT_MOD_NAMES), \ 6762 $(foreach prefix, @executable_path/../Frameworks/ $(VBOX_PATH_QT)/Frameworks/ $(PATH_SDK_QT)/, \ 6763 -change "$(prefix)$(qtmod).framework/Versions/5/$(qtmod)" \ 6764 "$(if $(VBOX_WITH_HARDENING),/Applications/VirtualBox.app/Contents/Frameworks,@rpath)/$(qtmod).framework/Versions/5/$(qtmod)" ) ) "$(out)" 6765 endif 6760 6766 6761 6767 # -
trunk/Makefile.kmk
r82968 r83033 179 179 Frameworks/$(qtmod).framework/$(qtmod)=>Versions/5/$(qtmod) \ 180 180 Frameworks/$(qtmod).framework/Resources=>Versions/5/Resources) 181 qt5-bin_INSTALLER = $(INSTALL) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) $(if $(mode),-m $(mode)) $(4) -- \ 182 "$(1)" "$(2)" $(if-expr "$(source_type_prefix)" == "EXEC_" \ 183 ,$(NLTAB)install_name_tool \ 184 $(if-expr "$(suffix $2)" == "", -id "$(if $(VBOX_WITH_HARDENING),/Applications/VirtualBox.app/Contents/Framework,@rpath)/$(notdir $(2)).framework/Version/5/$(notdir $(2))",) \ 185 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), \ 186 $(foreach prefix, @executable_path/../Frameworks/ $(VBOX_PATH_QT)/Frameworks/ $(PATH_SDK_QT)/, \ 187 -change "$(prefix)$(qtmod).framework/Versions/5/$(qtmod)" \ 188 "$(if $(VBOX_WITH_HARDENING),/Applications/VirtualBox.app/Contents/Frameworks,@rpath)/$(qtmod).framework/Versions/5/$(qtmod)" ) ) \ 189 "$(2)",) # HACK ALERT! Using $(source_type_prefix) to detect EXEC_SOURCES. 181 190 else # win x11 182 191 if1of ($(KBUILD_TARGET), linux solaris) -
trunk/include/VBox/sup.h
r82968 r83033 1184 1184 /** The hardened DLL has a "TrustedError" function (see FNSUPTRUSTEDERROR). */ 1185 1185 #define SUPSECMAIN_FLAGS_TRUSTED_ERROR RT_BIT_32(1) 1186 /** Hack for making VirtualBoxVM use VirtualBox.dylib on Mac OS X. */ 1186 /** Hack for making VirtualBoxVM use VirtualBox.dylib on Mac OS X. 1187 * @note Not used since 6.0 */ 1187 1188 #define SUPSECMAIN_FLAGS_OSX_VM_APP RT_BIT_32(2) 1188 1189 /** Program binary location mask. */ 1189 #define SUPSECMAIN_FLAGS_LOC_MASK UINT32_C(0x000000 10)1190 #define SUPSECMAIN_FLAGS_LOC_MASK UINT32_C(0x00000030) 1190 1191 /** Default binary location is the application binary directory. Does 1191 1192 * not need to be given explicitly (it's 0). */ … … 1194 1195 * default application binary directory. */ 1195 1196 #define SUPSECMAIN_FLAGS_LOC_TESTCASE UINT32_C(0x00000010) 1196 /** The first process. */ 1197 #define SUPSECMAIN_FLAGS_FIRST_PROCESS UINT32_C(0x00000020) 1197 /** The binary is located in a nested application bundle under Resources/ in the 1198 * main Mac OS X application (think Resources/VirtualBoxVM.app). */ 1199 #define SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP UINT32_C(0x00000020) 1200 /** The first process. 1201 * @internal */ 1202 #define SUPSECMAIN_FLAGS_FIRST_PROCESS UINT32_C(0x00000100) 1198 1203 /** @} */ 1199 1204 -
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r83008 r83033 55 55 ifdef VBOX_WITH_HARDENING 56 56 VirtualBoxHardenedVM_TEMPLATE = VBOXR3HARDENEDEXE 57 VirtualBoxHardenedVM_INST.darwin = $(INST_VIRTUALBOX)Contents/Resources/VirtualBoxVM.app/Contents/MacOS/ 58 VirtualBoxHardenedVM_NAME = VirtualBoxVM 57 59 VirtualBoxHardenedVM_SOURCES = src/hardenedmain.cpp 58 VirtualBoxHardenedVM_NAME = VirtualBoxVM59 60 VirtualBoxHardenedVM_LDFLAGS.win = /SUBSYSTEM:$(if-expr "$(KBUILD_TYPE)" != "release",console,windows) 60 61 $(call VBOX_SET_VER_INFO_EXE,VirtualBoxHardenedVM,VirtualBox Virtual Machine,$(VBOX_WINDOWS_ICON_FILE)) … … 161 162 VirtualBoxVM_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXQTGUI,VBOXQTGUIEXE) 162 163 VirtualBoxVM_NAME = VirtualBoxVM 164 ifndef VBOX_WITH_HARDENING 165 VirtualBoxVM_INST.darwin = $(INST_VIRTUALBOX)Contents/Resources/VirtualBoxVM.app/Contents/MacOS/ 166 endif 163 167 VirtualBoxVM_DEPS = $(UICommon_0_OUTDIR)/include/COMWrappers 164 168 VirtualBoxVM_SDKS.win = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) … … 388 392 389 393 VirtualBox_LDFLAGS.darwin = \ 394 $(if $(VBOX_WITH_HARDENING),,-rpath @executable_path/../MacOS -rpath @executable_path/../Frameworks) \ 390 395 -framework AppKit -framework Carbon -framework IOKit 391 396 … … 422 427 423 428 VirtualBoxVM_LDFLAGS.darwin = \ 429 $(if $(VBOX_WITH_HARDENING)\ 430 ,-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBoxVM.dylib \ 431 ,-rpath @executable_path/../../../../MacOS \ 432 -rpath @executable_path/../../../../Frameworks) \ 424 433 -framework AppKit -framework Carbon -framework IOKit \ 425 $(if $(VBOX_WITH_HARDENING),-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBoxVM.dylib)426 434 427 435 if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL) … … 447 455 448 456 UICommon_LDFLAGS.darwin = \ 449 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/UICommon.dylib\457 -install_name "$(VBOX_DYLD_EXECUTABLE_PATH)/UICommon.dylib" \ 450 458 -framework AppKit \ 451 459 -framework Carbon \ … … 1778 1786 $(VirtualBoxVM.app_0_OUTDIR)/VM-Info.plist=>Info.plist \ 1779 1787 $(foreach mysrc,$(VirtualBox.app_SOURCES),$(if-expr $(pos =>Resources/,$(mysrc)) > 0,$(mysrc),)) 1780 VirtualBoxVM.app_SYMLINKS = \1781 MacOS=>../../../MacOS/ \1782 plugins=>../../../plugins/ \1783 Frameworks=>../../../Frameworks/1784 1788 1785 1789 $$(VirtualBoxVM.app_0_OUTDIR)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/platform/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(@D)/ -
trunk/src/VBox/Frontends/VirtualBox/src/hardenedmain.cpp
r82968 r83033 64 64 65 65 uint32_t fFlags = (fStartVM && !fSeparateProcess) ? 0 : SUPSECMAIN_FLAGS_DONT_OPEN_DEV; 66 #ifdef RT_OS_DARWIN 67 fFlags |= SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP; 68 #endif 66 69 67 70 return SUPR3HardenedMain("VirtualBoxVM", -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r82968 r83033 54 54 # include <iprt/ctype.h> 55 55 #endif 56 #if defined(VBOX_RUNTIME_UI) && defined(VBOX_WS_MAC) 57 # include <iprt/path.h> 58 #endif 56 59 57 60 /* Other includes: */ … … 59 62 # include <dlfcn.h> 60 63 # include <sys/mman.h> 64 # ifdef VBOX_RUNTIME_UI 65 //# include <mach-o/dyld.h> 66 extern "C" const char *_dyld_get_image_name(uint32_t); 67 # endif 61 68 #endif /* VBOX_WS_MAC */ 62 69 #ifdef VBOX_WS_X11 … … 702 709 /* Instantiate own NSApplication before QApplication do it for us: */ 703 710 UICocoaApplication::instance(); 711 712 # ifdef VBOX_RUNTIME_UI 713 /* If we're a helper app inside Resources in the main application bundle, 714 we need to amend the library path so the platform plugin can be found. 715 Note! This builds on the initIprtForDarwinHelperApp() hack. */ 716 { 717 char szExecDir[RTPATH_MAX]; 718 int vrc = RTPathExecDir(szExecDir, sizeof(szExecDir)); 719 AssertRC(vrc); 720 RTPathStripTrailingSlash(szExecDir); /* .../Contents/MacOS */ 721 RTPathStripFilename(szExecDir); /* .../Contents */ 722 RTPathAppend(szExecDir, sizeof(szExecDir), "plugins"); /* .../Contents/plugins */ 723 QCoreApplication::addLibraryPath(QString::fromUtf8(szExecDir)); 724 } 725 # endif 704 726 #endif /* VBOX_WS_MAC */ 705 727 … … 842 864 843 865 #if !defined(VBOX_WITH_HARDENING) || !defined(VBOX_RUNTIME_UI) 866 867 # if defined(RT_OS_DARWIN) && defined(VBOX_RUNTIME_UI) 868 /** Init runtime with the executable path pointing into the 869 * VirtualBox.app/Contents/MacOS/ rather than 870 * VirtualBox.app/Contents/Resource/VirtualBoxVM.app/Contents/MacOS/. 871 * 872 * This is a HACK to make codesign and friends happy on OS X. The idea is to 873 * improve and eliminate this over time. 874 */ 875 DECL_NO_INLINE(static, int) initIprtForDarwinHelperApp(int cArgs, char ***ppapszArgs, uint32_t fFlags) 876 { 877 const char *pszImageName = _dyld_get_image_name(0); 878 AssertReturn(pszImageName, VERR_INTERNAL_ERROR); 879 880 char szTmpPath[PATH_MAX + 1]; 881 const char *psz = realpath(pszImageName, szTmpPath); 882 int rc; 883 if (psz) 884 { 885 char *pszFilename = RTPathFilename(szTmpPath); 886 if (pszFilename) 887 { 888 char const chSavedFilename0 = *pszFilename; 889 *pszFilename = '\0'; 890 RTPathStripTrailingSlash(szTmpPath); /* VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS */ 891 RTPathStripFilename(szTmpPath); /* VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/ */ 892 RTPathStripFilename(szTmpPath); /* VirtualBox.app/Contents/Resources/VirtualBoxVM.app */ 893 RTPathStripFilename(szTmpPath); /* VirtualBox.app/Contents/Resources */ 894 RTPathStripFilename(szTmpPath); /* VirtualBox.app/Contents */ 895 char *pszDst = strchr(szTmpPath, '\0'); 896 pszDst = (char *)memcpy(pszDst, RT_STR_TUPLE("/MacOS/")) + sizeof("/MacOS/") - 1; /** @todo where is mempcpy? */ 897 *pszFilename = chSavedFilename0; 898 memmove(pszDst, pszFilename, strlen(pszFilename) + 1); 899 900 return RTR3InitEx(RTR3INIT_VER_CUR, fFlags, cArgs, ppapszArgs, szTmpPath); 901 } 902 rc = VERR_INVALID_NAME; 903 } 904 else 905 rc = RTErrConvertFromErrno(errno); 906 AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhxs\n", rc, pszImageName, strlen(pszImageName), pszImageName), rc); 907 return rc; 908 } 909 # endif 910 844 911 845 912 int main(int argc, char **argv, char **envp) … … 871 938 872 939 uint32_t fFlags = fStartVM && !fSeparateProcess ? RTR3INIT_FLAGS_SUPLIB : 0; 940 # ifdef RT_OS_DARWIN 941 int rc = initIprtForDarwinHelperApp(argc, &argv, fFlags); 873 942 # else 874 uint32_t fFlags = 0;875 # endif876 943 int rc = RTR3InitExe(argc, &argv, fFlags); 944 # endif 945 # else 946 int rc = RTR3InitExe(argc, &argv, 0 /*fFlags*/); 947 # endif 877 948 878 949 /* Initialization failed: */ -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r82968 r83033 185 185 kSupID_AppPrivNoArch, 186 186 kSupID_Testcase, 187 #ifdef RT_OS_DARWIN 188 kSupID_AppMacHelper, 189 #endif 187 190 kSupID_End 188 191 } SUPINSTDIR; … … 448 451 449 452 DECLHIDDEN(int) supR3HardenedVerifyAll(bool fFatal, const char *pszProgName, const char *pszExePath, uint32_t fMainFlags); 450 DECLHIDDEN(int) supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal );453 DECLHIDDEN(int) supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal, PCSUPINSTFILE pFile); 451 454 DECLHIDDEN(int) supR3HardenedVerifyFixedFile(const char *pszFilename, bool fFatal); 452 455 DECLHIDDEN(int) supR3HardenedVerifyDir(const char *pszDirPath, bool fRecursive, bool fCheckFiles, PRTERRINFO pErrInfo); -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r82968 r83033 452 452 #include <iprt/initterm.h> 453 453 #include <iprt/param.h> 454 #include <iprt/path.h> 454 455 455 456 #include "SUPLibInternal.h" … … 542 543 /** The application bin directory path. */ 543 544 static char g_szSupLibHardenedAppBinPath[RTPATH_MAX]; 545 /** The offset into g_szSupLibHardenedExePath of the executable name. */ 546 static size_t g_offSupLibHardenedExecName; 547 /** The length of the executable name in g_szSupLibHardenedExePath. */ 548 static size_t g_cchSupLibHardenedExecName; 544 549 545 550 /** The program name. */ … … 1345 1350 suplibHardenedPathStripFilename(g_szSupLibHardenedAppBinPath); 1346 1351 1352 g_offSupLibHardenedExecName = suplibHardenedStrLen(g_szSupLibHardenedAppBinPath); 1353 while (RTPATH_IS_SEP(g_szSupLibHardenedExePath[g_offSupLibHardenedExecName])) 1354 g_offSupLibHardenedExecName++; 1355 g_cchSupLibHardenedExecName = suplibHardenedStrLen(&g_szSupLibHardenedExePath[g_offSupLibHardenedExecName]); 1356 1347 1357 if (g_enmSupR3HardenedMainState < SUPR3HARDENEDMAINSTATE_HARDENED_MAIN_CALLED) 1348 1358 supR3HardenedFatal("supR3HardenedExecDir: Called before SUPR3HardenedMain! (%d)\n", g_enmSupR3HardenedMainState); … … 1354 1364 suplibHardenedPathStripFilename(g_szSupLibHardenedAppBinPath); 1355 1365 break; 1366 #ifdef RT_OS_DARWIN 1367 case SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP: 1368 { 1369 /* We must ascend to the parent bundle's Contents directory then decend into its MacOS: */ 1370 static const RTSTRTUPLE s_aComponentsToSkip[] = 1371 { { RT_STR_TUPLE("MacOS") }, { RT_STR_TUPLE("Contents") }, { NULL /*some.app*/, 0 }, { RT_STR_TUPLE("Resources") } }; 1372 size_t cchPath = suplibHardenedStrLen(g_szSupLibHardenedAppBinPath); 1373 for (uintptr_t i = 0; i < RT_ELEMENTS(s_aComponentsToSkip); i++) 1374 { 1375 while (cchPath > 1 && g_szSupLibHardenedAppBinPath[cchPath - 1] == '/') 1376 cchPath--; 1377 size_t const cchMatch = s_aComponentsToSkip[i].cch; 1378 if (cchMatch > 0) 1379 { 1380 if ( cchPath >= cchMatch + sizeof("VirtualBox.app/Contents") 1381 && g_szSupLibHardenedAppBinPath[cchPath - cchMatch - 1] == '/' 1382 && suplibHardenedMemComp(&g_szSupLibHardenedAppBinPath[cchPath - cchMatch], 1383 s_aComponentsToSkip[i].psz, cchMatch) == 0) 1384 cchPath -= cchMatch; 1385 else 1386 supR3HardenedFatal("supR3HardenedExecDir: Bad helper app path (tail component #%u '%s'): %s\n", 1387 i, s_aComponentsToSkip[i].psz, g_szSupLibHardenedAppBinPath); 1388 } 1389 else if ( cchPath > g_cchSupLibHardenedExecName + sizeof("VirtualBox.app/Contents/Resources/.app") 1390 && suplibHardenedMemComp(&g_szSupLibHardenedAppBinPath[cchPath - 4], ".app", 4) == 0 1391 && suplibHardenedMemComp(&g_szSupLibHardenedAppBinPath[cchPath - 4 - g_cchSupLibHardenedExecName], 1392 &g_szSupLibHardenedExePath[g_offSupLibHardenedExecName], 1393 g_cchSupLibHardenedExecName) == 0) 1394 cchPath -= g_cchSupLibHardenedExecName + 4; 1395 else 1396 supR3HardenedFatal("supR3HardenedExecDir: Bad helper app path (tail component #%u '%s.app'): %s\n", 1397 i, &g_szSupLibHardenedExePath[g_offSupLibHardenedExecName], g_szSupLibHardenedAppBinPath); 1398 } 1399 suplibHardenedMemCopy(&g_szSupLibHardenedAppBinPath[cchPath], "MacOS", sizeof("MacOS")); 1400 break; 1401 } 1402 #endif /* RT_OS_DARWIN */ 1356 1403 default: 1357 1404 supR3HardenedFatal("supR3HardenedExecDir: Unknown program binary location: %#x\n", g_fSupHardenedMain); … … 2326 2373 { 2327 2374 case SUPSECMAIN_FLAGS_LOC_APP_BIN: 2375 #ifdef RT_OS_DARWIN 2376 case SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP: 2377 #endif 2328 2378 pszSubDirSlash = "/"; 2329 2379 break; -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
r82968 r83033 195 195 //#ifdef VBOX_WITH_QTGUI 196 196 { kSupIFT_Exe, kSupID_AppBin, true, "VirtualBox" SUPLIB_EXE_SUFF }, 197 # ifdef RT_OS_DARWIN 198 { kSupIFT_Exe, kSupID_AppMacHelper, true, "VirtualBoxVM" SUPLIB_EXE_SUFF }, 199 # else 197 200 { kSupIFT_Exe, kSupID_AppBin, true, "VirtualBoxVM" SUPLIB_EXE_SUFF }, 201 # endif 198 202 { kSupIFT_Dll, kSupID_AppPrivArch, true, "VirtualBoxVM" SUPLIB_DLL_SUFF }, 199 203 { kSupIFT_Dll, kSupID_AppPrivArch, true, "UICommon" SUPLIB_DLL_SUFF }, … … 267 271 * @param cchDst The size of the buffer. 268 272 * @param fFatal Whether failures should be treated as fatal (true) or not (false). 269 */ 270 static int supR3HardenedMakePath(SUPINSTDIR enmDir, char *pszDst, size_t cchDst, bool fFatal) 273 * @param pFile The file (for darwin helper app paths). 274 */ 275 static int supR3HardenedMakePath(SUPINSTDIR enmDir, char *pszDst, size_t cchDst, bool fFatal, PCSUPINSTFILE pFile) 271 276 { 272 277 int rc; … … 307 312 } 308 313 break; 314 #ifdef RT_OS_DARWIN 315 case kSupID_AppMacHelper: 316 rc = supR3HardenedPathAppBin(pszDst, cchDst); 317 if (RT_SUCCESS(rc)) 318 { 319 /* Up one level from the VirtualBox.app/Contents/MacOS directory: */ 320 size_t offDst = suplibHardenedStrLen(pszDst); 321 while (offDst > 1 && pszDst[offDst - 1] == '/') 322 offDst--; 323 while (offDst > 1 && pszDst[offDst - 1] != '/') 324 offDst--; 325 326 /* Construct the path to the helper application's Contents/MacOS directory: */ 327 size_t cchFile = suplibHardenedStrLen(pFile->pszFile); 328 if (offDst + cchFile + sizeof("Resources/.app/Contents/MacOS") <= cchDst) 329 { 330 suplibHardenedMemCopy(&pszDst[offDst], RT_STR_TUPLE("Resources/")); 331 offDst += sizeof("Resources/") - 1; 332 suplibHardenedMemCopy(&pszDst[offDst], pFile->pszFile, cchFile); 333 offDst += cchFile; 334 suplibHardenedMemCopy(&pszDst[offDst], RT_STR_TUPLE(".app/Contents/MacOS") + 1); 335 } 336 else 337 rc = VERR_BUFFER_OVERFLOW; 338 } 339 break; 340 #endif 309 341 default: 310 342 return supR3HardenedError(VERR_INTERNAL_ERROR, fFatal, … … 314 346 supR3HardenedError(rc, fFatal, 315 347 "supR3HardenedMakePath: enmDir=%d rc=%d\n", enmDir, rc); 348 NOREF(pFile); 316 349 return rc; 317 350 } … … 336 369 * Combine supR3HardenedMakePath and the filename. 337 370 */ 338 int rc = supR3HardenedMakePath(pFile->enmDir, pszDst, cchDst, fFatal );371 int rc = supR3HardenedMakePath(pFile->enmDir, pszDst, cchDst, fFatal, pFile); 339 372 if (RT_SUCCESS(rc) && fWithFilename) 340 373 { … … 363 396 * @param fFatal Whether validation failures should be treated as 364 397 * fatal (true) or not (false). 365 */ 366 DECLHIDDEN(int) supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal) 398 * @param pFile The file (for darwin helper app paths). 399 */ 400 DECLHIDDEN(int) supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal, PCSUPINSTFILE pFile) 367 401 { 368 402 /* … … 391 425 */ 392 426 char szPath[RTPATH_MAX]; 393 int rc = supR3HardenedMakePath(enmDir, szPath, sizeof(szPath), fFatal );427 int rc = supR3HardenedMakePath(enmDir, szPath, sizeof(szPath), fFatal, pFile); 394 428 if (RT_SUCCESS(rc)) 395 429 { … … 676 710 * use openat if we wish.) 677 711 */ 678 int rc = supR3HardenedVerifyFixedDir(pFile->enmDir, fFatal );712 int rc = supR3HardenedVerifyFixedDir(pFile->enmDir, fFatal, pFile); 679 713 if (RT_SUCCESS(rc)) 680 714 { -
trunk/src/VBox/Installer/darwin/Makefile.kmk
r82996 r83033 361 361 362 362 VBOX_DI_VBAPP_PROGS_HARDENED = \ 363 MacOS/VirtualBoxVM \363 Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM \ 364 364 MacOS/VBoxHeadless \ 365 365 MacOS/VBoxNetDHCP \ … … 414 414 endif 415 415 ifdef VBOX_WITH_HARDENING 416 VBOX_DI_VBAPP_DYLIBS += $(add suffix .dylib,$(VBOX_DI_VBAPP_PROGS_HARDENED))416 VBOX_DI_VBAPP_DYLIBS += $(addprefix MacOS/,$(addsuffix .dylib,$(notdir $(VBOX_DI_VBAPP_PROGS_HARDENED)))) 417 417 endif 418 418 ifdef VBOX_WITH_HDDPARALLELS_INSTALL … … 522 522 523 523 VBOX_DI_VBAPP_SYMLINKS = \ 524 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \525 Resources/VirtualBoxVM.app/Contents/plugins=>../../../plugins/ \526 Resources/VirtualBoxVM.app/Contents/Frameworks=>../../../Frameworks/ \527 524 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \ 528 525 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \ … … 684 681 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_PROGS_HARDENED) \ 685 682 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(prog)$(NLTAB)) 686 #ifdef VBOX_WITH_HARDENING - disabled temporarily687 if 1688 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.689 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \690 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \691 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod)$(NLTAB) )692 $(foreach f, \693 $(VBOX_DI_VBAPP_DYLIBS) \694 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \695 $(VBOX_DI_VBAPP_PROGS) \696 $(VBOX_DI_VBAPP_PROGS_HARDENED) \697 ,install_name_tool \698 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), \699 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \700 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \701 -change $(VBOX_PATH_QT)/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \702 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \703 -change $(PATH_SDK_QT)/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \704 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \705 -change $(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \706 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod) \707 ) \708 $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )709 endif710 683 ifdef VBOX_UNATTENDED_TEMPLATES 711 684 # Unattended installation template scripts. … … 780 753 sudo chmod u+s $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/VBoxNetAdpCtl 781 754 ifdef VBOX_WITH_HARDENING 782 sudo chmod u+s \ 783 $(foreach bin,VBoxHeadless VirtualBoxVM VBoxNetDHCP VBoxNetNAT,\ 784 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(bin)) 755 sudo chmod u+s $(foreach bin,$(VBOX_DI_VBAPP_PROGS_HARDENED),$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin)) 756 endif 757 if 0 # Handy for testing the app bundle w/o having to reinstall all the time (just untar it into -C /Applications/) 758 $(RM) -f -- "$(PATH_OUT)/VirtualBox.app.tar.gz" 759 tar -czf "$(PATH_OUT)/VirtualBox.app.tar.gz" -C "$(VBOX_PATH_VBOX_APP_TMP)/.." VirtualBox.app 785 760 endif 786 761 @# Do keyword replacement in the package info and description files.
Note:
See TracChangeset
for help on using the changeset viewer.