Changeset 92663 in vbox for trunk/src/VBox
- Timestamp:
- Dec 1, 2021 2:55:35 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
r92662 r92663 1049 1049 AssertPtrReturn(pszArgv0, VERR_INVALID_POINTER); 1050 1050 AssertPtrReturn(ppapszArgv, VERR_INVALID_POINTER); 1051 AssertReturn(!(fFlags & EXECUTEPROCESSFLAG_EXPAND_ARGUMENTS), VERR_INVALID_FLAGS); /** @todo implement me */ 1051 1052 1052 1053 #ifndef VBOXSERVICE_ARG1_UTF8_ARGV … … 1078 1079 #endif 1079 1080 1080 /* HACK ALERT! Older hosts (< VBox 6.1.x) did not allow the user to really specify the first 1081 argument separately from the executable image, so we have to fudge 1082 a little in the unquoted argument case to deal with executables 1083 containing spaces. */ 1084 /** @todo r=bird: WTF!?? This makes absolutely no sense on non-windows. An 1085 * on windows the first flag test must be inverted, as it's when RTProcCreateEx 1086 * doesn't do any quoting that we have to do it here, isn't it? 1087 * Aaaaaaaaaaaaaaaaaaarrrrrrrrrrrrrrrrrrrrrrrrrrgggggggggggggggggggggggg! */ 1088 if ( !(fFlags & EXECUTEPROCESSFLAG_UNQUOTED_ARGS) 1089 || !strpbrk(pszArgv0, " \t\n\r") 1090 || pszArgv0[0] == '"') 1091 { 1092 rc = RTStrDupEx(&papszNewArgv[0], pszArgv0); 1093 } 1094 else 1081 /* HACK ALERT! Older hosts (< VBox 6.1.x) did not allow the user to really specify 1082 the first argument separately from the executable image, so we have 1083 to fudge a little in the unquoted argument case to deal with executables 1084 containing spaces. Windows only, as RTPROC_FLAGS_UNQUOTED_ARGS is 1085 ignored on all other hosts. */ 1086 #ifdef RT_OS_WINDOWS 1087 if ( (fFlags & EXECUTEPROCESSFLAG_UNQUOTED_ARGS) 1088 && strpbrk(pszArgv0, " \t\n\r") 1089 && pszArgv0[0] == '"') 1095 1090 { 1096 1091 size_t cchArgv0 = strlen(pszArgv0); … … 1107 1102 } 1108 1103 } 1109 1104 else 1105 #endif 1106 rc = RTStrDupEx(&papszNewArgv[0], pszArgv0); 1110 1107 if (RT_SUCCESS(rc)) 1111 1108 {
Note:
See TracChangeset
for help on using the changeset viewer.