diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2023-03-23 18:00:47 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2023-03-23 18:00:47 +0000 |
commit | 653c669a8d8f20bab135104806594eb2b55ac8e9 (patch) | |
tree | 63ce1077533a7692ef57a3971131d3fba0660d58 | |
parent | 1463db36f348ae227ce4f37c5629864a7358848c (diff) | |
download | VirtualBox-svn-653c669a8d8f20bab135104806594eb2b55ac8e9.tar.gz |
Guest Control: Changed the parameter position of the CWD parameter, so that the image name and arguments are together again (feels more natural, was part of the initial patch). bugref:8053
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@99150 cfe28804-0f27-0410-a406-dd0f0b0b656f
6 files changed, 49 insertions, 41 deletions
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp index e89607d10fd..7cc0199a955 100644 --- a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp +++ b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp @@ -1363,8 +1363,8 @@ static RTEXITCODE gctlHandleRunCommon(PGCTLCMDCTX pCtx, int argc, char **argv, b } ComPtr<IGuestProcess> pProcess; CHECK_ERROR_BREAK(pCtx->pGuestSession, ProcessCreate(Bstr(pszImage).raw(), - Bstr(pszCwd).raw(), ComSafeArrayAsInParam(aArgs), + Bstr(pszCwd).raw(), ComSafeArrayAsInParam(aEnv), ComSafeArrayAsInParam(aCreateFlags), gctlRunGetRemainingTime(msStart, cMsTimeout), diff --git a/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlInterface.cpp b/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlInterface.cpp index f0048b45b6b..0cc97bb00a9 100644 --- a/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlInterface.cpp +++ b/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlInterface.cpp @@ -557,8 +557,8 @@ bool UIGuestControlInterface::startProcess(const CommandData &commandData, CGues QVector<KProcessCreateFlag> createFlags; createFlags.push_back(KProcessCreateFlag_WaitForProcessStartOnly); CGuestProcess process = guestSession.ProcessCreate(commandData.m_strExePath, - NULL /* CWD */, commandData.m_arguments, + "", /* Working directory. */ commandData.m_environmentChanges, createFlags, 0); diff --git a/src/VBox/Main/idl/VirtualBox.xidl b/src/VBox/Main/idl/VirtualBox.xidl index 6a7e80ecd96..75a9ad35b15 100644 --- a/src/VBox/Main/idl/VirtualBox.xidl +++ b/src/VBox/Main/idl/VirtualBox.xidl @@ -14813,7 +14813,7 @@ <interface name="IGuestSession" extends="$unknown" - uuid="5591bead-9c1d-4cbd-9669-2d0b04fac0a8" + uuid="5e54f60b-6dcd-4594-a6c9-cf968f004341" wsmap="managed" reservedMethods="8" reservedAttributes="12" > @@ -15965,17 +15965,6 @@ @a arguments array will be used instead (i.e. argv[0]). </desc> </param> - <param name="cwd" type="wstring" dir="in"> - <desc> - Path to the directory in which to execute in the guest. The - directory has to exist in the guest VM with search rights to the - session user in order to succeed. If empty/null, the session - user's default (typically 'home') directory is used. If not a - full path, it is interpreted relative to the default directory; - e.g. 'work' means '$HOME/work' (according to the guest's '$HOME'- - like concept). - </desc> - </param> <param name="arguments" type="wstring" dir="in" safearray="yes"> <desc>Array of arguments passed to the new process. <note> @@ -15987,6 +15976,17 @@ </note> </desc> </param> + <param name="cwd" type="wstring" dir="in"> + <desc> + Path to the directory in which to execute in the guest. The + directory has to exist in the guest VM with search rights to the + session user in order to succeed. If empty/null, the session + user's default (typically 'home') directory is used. If not a + full path, it is interpreted relative to the default directory; + e.g. 'work' means '$HOME/work' (according to the guest's '$HOME'- + like concept). + </desc> + </param> <param name="environmentChanges" type="wstring" dir="in" safearray="yes"> <desc> Set of environment changes to complement @@ -16027,17 +16027,6 @@ See <link to="IGuestSession::processCreate"/> for more information. </desc> - <param name="cwd" type="wstring" dir="in"> - <desc> - Path to the directory in which to execute in the guest. The - directory has to exist in the guest VM with search rights to the - session user in order to succeed. If empty/null, the session - user's default (typically 'home') directory is used. If not a - full path, it is interpreted relative to the default directory; - e.g. 'work' means '$HOME/work' (according to the guest's '$HOME'- - like concept). - </desc> - </param> <param name="executable" type="wstring" dir="in"> <desc> Full path to the file to execute in the guest. The file has to @@ -16057,6 +16046,17 @@ </note> </desc> </param> + <param name="cwd" type="wstring" dir="in"> + <desc> + Path to the directory in which to execute in the guest. The + directory has to exist in the guest VM with search rights to the + session user in order to succeed. If empty/null, the session + user's default (typically 'home') directory is used. If not a + full path, it is interpreted relative to the default directory; + e.g. 'work' means '$HOME/work' (according to the guest's '$HOME'- + like concept). + </desc> + </param> <param name="environmentChanges" type="wstring" dir="in" safearray="yes"> <desc> Set of environment changes to complement diff --git a/src/VBox/Main/include/GuestSessionImpl.h b/src/VBox/Main/include/GuestSessionImpl.h index 186514ef4bb..89554fa44eb 100644 --- a/src/VBox/Main/include/GuestSessionImpl.h +++ b/src/VBox/Main/include/GuestSessionImpl.h @@ -211,15 +211,15 @@ private: const com::Utf8Str &aAcl, ULONG aMode); HRESULT processCreate(const com::Utf8Str &aCommand, - const com::Utf8Str &aCwd, const std::vector<com::Utf8Str> &aArguments, + const com::Utf8Str &aCwd, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ComPtr<IGuestProcess> &aGuestProcess); HRESULT processCreateEx(const com::Utf8Str &aCommand, - const com::Utf8Str &aCwd, const std::vector<com::Utf8Str> &aArguments, + const com::Utf8Str &aCwd, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, diff --git a/src/VBox/Main/src-client/GuestSessionImpl.cpp b/src/VBox/Main/src-client/GuestSessionImpl.cpp index de2725f9436..3a6c7909843 100644 --- a/src/VBox/Main/src-client/GuestSessionImpl.cpp +++ b/src/VBox/Main/src-client/GuestSessionImpl.cpp @@ -4942,8 +4942,8 @@ HRESULT GuestSession::fsObjSetACL(const com::Utf8Str &aPath, BOOL aFollowSymlink } -HRESULT GuestSession::processCreate(const com::Utf8Str &aExecutable, const com::Utf8Str &aCwd, - const std::vector<com::Utf8Str> &aArguments, +HRESULT GuestSession::processCreate(const com::Utf8Str &aExecutable, const std::vector<com::Utf8Str> &aArguments, + const com::Utf8Str &aCwd, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ComPtr<IGuestProcess> &aGuestProcess) @@ -4951,12 +4951,12 @@ HRESULT GuestSession::processCreate(const com::Utf8Str &aExecutable, const com:: LogFlowThisFuncEnter(); std::vector<LONG> affinityIgnored; - return processCreateEx(aExecutable, aCwd, aArguments, aEnvironment, aFlags, aTimeoutMS, + return processCreateEx(aExecutable, aArguments, aCwd, aEnvironment, aFlags, aTimeoutMS, ProcessPriority_Default, affinityIgnored, aGuestProcess); } -HRESULT GuestSession::processCreateEx(const com::Utf8Str &aExecutable, const com::Utf8Str &aCwd, - const std::vector<com::Utf8Str> &aArguments, +HRESULT GuestSession::processCreateEx(const com::Utf8Str &aExecutable, const std::vector<com::Utf8Str> &aArguments, + const com::Utf8Str &aCwd, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ProcessPriority_T aPriority, const std::vector<LONG> &aAffinity, diff --git a/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py b/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py index 656c8fd8640..b9239ca054b 100755 --- a/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py +++ b/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py @@ -2319,8 +2319,9 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): % (oTest.sCmd, oTest.afFlags, oTest.timeoutMS, limitString(oTest.asArgs), limitString(oTest.aEnv),)); try: if self.oTstDrv.fpApiVer >= 7.1: - oProcess = oGuestSession.processCreate(oTest.sCmd, oTest.sCwd, + oProcess = oGuestSession.processCreate(oTest.sCmd, oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:], + oTest.sCwd, oTest.aEnv, oTest.afFlags, oTest.timeoutMS); else: oProcess = oGuestSession.processCreate(oTest.sCmd, @@ -2887,8 +2888,9 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): try: reporter.log2('Starting stale process #%d...' % (i)); if self.oTstDrv.fpApiVer >= 7.1: - oGuestSession.processCreate(sShell, "", + oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [], + "", # Working directory. [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000); else: oGuestSession.processCreate(sShell, @@ -2926,7 +2928,8 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): try: reporter.log2('Starting non-stale process #%d...' % (i)); if self.oTstDrv.fpApiVer >= 7.1: - oCurProc = oGuestSession.processCreate(sShell, "", asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], + oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], + "", # Working directory. [], [], 0); # Infinite timeout. else: oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], @@ -2983,7 +2986,8 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): try: reporter.log2('Starting blocking process #%d...' % (i)); if self.oTstDrv.fpApiVer >= 7.1: - oCurProc = oGuestSession.processCreate(sCmd, "", asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], + oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], + "", # Working directory. [], [], 30 * 1000); else: oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], @@ -3418,8 +3422,9 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): afFlags = []; try: if self.oTstDrv.fpApiVer >= 7.1: - oGuestProcess = oGuestSession.processCreate(sImage, "", + oGuestProcess = oGuestSession.processCreate(sImage, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags, + "", # Working directory. 30 * 1000); else: oGuestProcess = oGuestSession.processCreate(sImage, @@ -3539,7 +3544,8 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): fRc = True; try: if self.oTstDrv.fpApiVer >= 7.1: - oCurProcess = oGuestSession.processCreate(sShell, "", [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], + oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], + "", # Working directory. [], [], 30 * 1000); else: oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], @@ -3581,8 +3587,9 @@ class SubTstDrvAddGuestCtrl(base.SubTestDriverBase): # try: if self.oTstDrv.fpApiVer >= 7.1: - oCurProcess = oGuestSession.processCreate(sShell, "", [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], - [], [], 3 * 1000); + oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], + "", # Working directory. + [], [], 3 * 1000); else: oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [], [], [], 3 * 1000); @@ -5576,7 +5583,8 @@ class tdAddGuestCtrl(vbox.TestDriver): # afFlags = []; for _ in xrange(100): - oProc = oGuestSession.processCreate(sCmd, "", asArgs if self.fpApiVer >= 5.0 else asArgs[1:], + oProc = oGuestSession.processCreate(sCmd, asArgs if self.fpApiVer >= 5.0 else asArgs[1:], + "", # Working directory. aEnv, afFlags, 30 * 1000); aWaitFor = [ vboxcon.ProcessWaitForFlag_Terminate ]; |