Changeset 83405 in vbox
- Timestamp:
- Mar 25, 2020 12:45:01 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestControlSvc.h
r82968 r83405 139 139 * The host wants to execute something in the guest. This can be a command 140 140 * line or starting a program. 141 * @note Legacy (VBox < 4.3) message.142 141 */ 143 142 HOST_MSG_EXEC_CMD = 100, 144 143 /** 145 144 * Sends input data for stdin to a running process executed by HOST_EXEC_CMD. 146 * @note Legacy (VBox < 4.3) message.147 145 */ 148 146 HOST_MSG_EXEC_SET_INPUT = 101, … … 150 148 * Gets the current status of a running process, e.g. 151 149 * new data on stdout/stderr, process terminated etc. 152 * @note Legacy (VBox < 4.3) message.153 150 */ 154 151 HOST_MSG_EXEC_GET_OUTPUT = 102, … … 692 689 * @{ */ 693 690 /** Supports HOST_MSG_FILE_SET_SIZE. */ 694 #define VBOX_GUESTCTRL_GF_0_SET_SIZE RT_BIT_64(0) 691 #define VBOX_GUESTCTRL_GF_0_SET_SIZE RT_BIT_64(0) 692 /** Supports (fixes) treating argv[0] separately from the actual execution command. 693 * Without this flag the actual execution command is taken as argv[0]. */ 694 #define VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0 RT_BIT_64(1) 695 695 /** Bit that must be set in the 2nd parameter, will be cleared if the host reponds 696 696 * correctly (old hosts might not). */ 697 #define VBOX_GUESTCTRL_GF_1_MUST_BE_ONE RT_BIT_64(63)697 #define VBOX_GUESTCTRL_GF_1_MUST_BE_ONE RT_BIT_64(63) 698 698 /** @} */ 699 699 … … 704 704 * GUEST_FILE_NOTIFYTYPE_WRITE_OFFSET notification types. */ 705 705 #define VBOX_GUESTCTRL_HF_0_NOTIFY_RDWR_OFFSET RT_BIT_64(0) 706 /** Host supports sending (treating) argv[0] separately from the actual execution command. 707 * Needed when newer Guest Additions which support VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0 run on an older 708 * host which doesn't in turn support VBOX_GUESTCTRL_HF_0_PROCESS_ARGV0. */ 709 #define VBOX_GUESTCTRL_HF_0_PROCESS_ARGV0 RT_BIT_64(1) 706 710 /** @} */ 707 711 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r82968 r83405 216 216 * Report features to the host. 217 217 */ 218 rc = VbglR3GuestCtrlReportFeatures(g_idControlSvcClient, VBOX_GUESTCTRL_GF_0_SET_SIZE, &g_fControlHostFeatures0); 218 const uint64_t fGuestFeatures = VBOX_GUESTCTRL_GF_0_SET_SIZE 219 | VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0; 220 221 rc = VbglR3GuestCtrlReportFeatures(g_idControlSvcClient, fGuestFeatures, &g_fControlHostFeatures0); 219 222 if (RT_SUCCESS(rc)) 220 223 VGSvcVerbose(3, "Host features: %#RX64\n", g_fControlHostFeatures0); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
r83400 r83405 1071 1071 #endif 1072 1072 1073 /* HACK ALERT! Since we still don't allow the user to really specify the first1074 argument separately from the executable image, we have to fudge1073 /* HACK ALERT! Older hosts (< VBox 6.1.x) did not allow the user to really specify the first 1074 argument separately from the executable image, so we have to fudge 1075 1075 a little in the unquoted argument case to deal with executables 1076 1076 containing spaces. */ 1077 /** @todo Fix the stupid host/guest protocol so the user can do this for us! */1078 1077 if ( !(fFlags & EXECUTEPROCESSFLAG_UNQUOTED_ARGS) 1079 1078 || !strpbrk(pszArgv0, " \t\n\r") … … 1094 1093 } 1095 1094 } 1095 1096 1096 if (RT_SUCCESS(rc)) 1097 1097 { … … 1342 1342 if (RT_SUCCESS(rc)) 1343 1343 { 1344 const char *pszArgv0 = RT_BOOL(g_fControlHostFeatures0 & VBOX_GUESTCTRL_HF_0_PROCESS_ARGV0) 1345 ? papszArgs[0] : pszExec; 1344 1346 char **papszArgsExp; 1345 /** @todo r-bird: pszExec != argv[0]! When are you going to get that?!? How many 1346 * times does this need to be pointed out? HOST/GUEST INTERFACE IS MISDESIGNED! */ 1347 rc = vgsvcGstCtrlProcessAllocateArgv(pszExec /* Always use the unmodified executable name as argv0. */, 1348 papszArgs /* Append the rest of the argument vector (if any). */, 1347 rc = vgsvcGstCtrlProcessAllocateArgv(pszArgv0, papszArgs, 1349 1348 fFlags, &papszArgsExp); 1350 1349 if (RT_FAILURE(rc)) -
trunk/src/VBox/HostServices/GuestControl/VBoxGuestControlSvc.cpp
r82968 r83405 934 934 935 935 /** Host feature mask for GUEST_MSG_REPORT_FEATURES/GUEST_MSG_QUERY_FEATURES. */ 936 static uint64_t const g_fGstCtrlHostFeatures0 = VBOX_GUESTCTRL_HF_0_NOTIFY_RDWR_OFFSET ;937 936 static uint64_t const g_fGstCtrlHostFeatures0 = VBOX_GUESTCTRL_HF_0_NOTIFY_RDWR_OFFSET 937 | VBOX_GUESTCTRL_HF_0_PROCESS_ARGV0; 938 938 939 939 -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r82968 r83405 35 35 # error "VBOX_WITH_GUEST_CONTROL must defined in this file" 36 36 #endif 37 #include "GuestImpl.h" 37 38 #include "GuestProcessImpl.h" 38 39 #include "GuestSessionImpl.h" … … 1077 1078 papszArgv[cArgs] = NULL; 1078 1079 1079 if (uProtocol < UINT32_C(0xdeadbeef) ) /** @todo implement a way of sending argv[0], best idea is a new command. */ 1080 Guest *pGuest = mSession->i_getParent(); 1081 AssertPtr(pGuest); 1082 1083 /* If the Guest Additions don't support using argv[0] correctly (< 6.1.x), don't supply it. */ 1084 if (!RT_BOOL(pGuest->i_getGuestControlFeatures0() & VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0)) 1080 1085 vrc = RTGetOptArgvToString(&pszArgs, papszArgv + 1, RTGETOPTARGV_CNV_QUOTE_BOURNE_SH); 1081 else 1086 else /* ... else send the whole argv, including argv[0]. */ 1082 1087 vrc = RTGetOptArgvToString(&pszArgs, papszArgv, RTGETOPTARGV_CNV_QUOTE_BOURNE_SH); 1083 1088
Note:
See TracChangeset
for help on using the changeset viewer.