Changeset 47915 in vbox
- Timestamp:
- Aug 20, 2013 2:00:58 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r47776 r47915 4071 4071 /* Check whether the flag to allow silent storage attachment reconfiguration is set. */ 4072 4072 strReconfig = getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused")); 4073 if (FAILED(rc))4074 return rc;4075 4073 if ( mData->mMachineState == MachineState_Paused 4076 4074 && strReconfig == "1") … … 4635 4633 /* Check whether the flag to allow silent storage attachment reconfiguration is set. */ 4636 4634 strReconfig = getExtraData(Utf8Str("VBoxInternal2/SilentReconfigureWhilePaused")); 4637 if (FAILED(rc))4638 return rc;4639 4635 if ( mData->mMachineState == MachineState_Paused 4640 4636 && strReconfig == "1") … … 7935 7931 szPath[sz] = 0; 7936 7932 char *cmd = szPath + sz; 7937 sz = RTPATH_MAX- sz;7933 sz = sizeof(szPath) - sz; 7938 7934 7939 7935 int vrc = VINF_SUCCESS; … … 7995 7991 { 7996 7992 # ifdef RT_OS_DARWIN /* Avoid Launch Services confusing this with the selector by using a helper app. */ 7997 const char VirtualBox_exe[] = "../Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM"; 7993 /* Modify the base path so that we don't need to use ".." below. */ 7994 RTPathStripTrailingSlash(szPath); 7995 RTPathStripFilename(szPath); 7996 sz = strlen(szPath); 7997 cmd = szPath + sz; 7998 sz = sizeof(szPath) - sz; 7999 8000 #define OSX_APP_NAME "VirtualBoxVM" 8001 #define OSX_APP_PATH_FMT "/Resources/%s.app/Contents/MacOS/VirtualBoxVM" 8002 8003 Utf8Str strAppOverride = getExtraData(Utf8Str("VBoxInternal2/VirtualBoxVMAppOverride")); 8004 if ( strAppOverride.contains(".") 8005 || strAppOverride.contains("/") 8006 || strAppOverride.contains("\\") 8007 || strAppOverride.contains(":")) 8008 strAppOverride.setNull(); 8009 Utf8Str strAppPath; 8010 if (!strAppOverride.isEmpty()) 8011 { 8012 strAppPath = Utf8StrFmt(OSX_APP_PATH_FMT, strAppOverride.c_str()); 8013 Utf8Str strFullPath(szPath); 8014 strFullPath.append(strAppPath); 8015 /* there is a race, but people using this deserve the failure */ 8016 if (!RTFileExists(strFullPath.c_str())) 8017 strAppOverride.setNull(); 8018 } 8019 if (strAppOverride.isEmpty()) 8020 strAppPath = Utf8StrFmt(OSX_APP_PATH_FMT, OSX_APP_NAME); 8021 const char *VirtualBox_exe = strAppPath.c_str(); 8022 AssertReturn(sz >= strlen(VirtualBox_exe), E_UNEXPECTED); 7998 8023 # else 7999 8024 const char VirtualBox_exe[] = "VirtualBox" HOSTSUFF_EXE; 8025 Assert(sz >= sizeof(VirtualBox_exe)); 8000 8026 # endif 8001 Assert(sz >= sizeof(VirtualBox_exe));8002 8027 strcpy(cmd, VirtualBox_exe); 8003 8028
Note:
See TracChangeset
for help on using the changeset viewer.