VirtualBox

Opened 10 years ago

Closed 9 years ago

#13157 closed defect (fixed)

Double quotes in guestprocess arguments are removed or replaced with a backslash

Reported by: hakito Owned by:
Component: guest control Version: VirtualBox 4.3.12
Keywords: Cc:
Guest type: all Host type: Windows

Description

When executing a command on the guest via vboxmanage guestcontrol exec or the virtualbox api using double quotes within an argument, it get's replaced with a single backslash character in the guest command line.

For example:

vboxmanage guestcontrol Windows7 exec --username user --password pass --image c:\test.bat -- my""quote
vboxmanage guestcontrol Windows7 exec --username user --password pass --image c:\test.bat -- "my""quote"

Expected command lines:

cmd.exe /c c:\test.bat my""quote
cmd.exe /c c:\test.bat "my""quote"

Actual command lines:

cmd.exe /c c:\test.bat myquote
cmd.exe /c c:\test.bat my\quote

Change History (5)

comment:1 by Magnus Madsen, 9 years ago

I can verify this error occurs. I've been trying to find the cause in source, and I believe the problem lies with the RTGetOptArgvToString function found in VBox/Runtime/common/misc/getoptargv.cpp. It is used to convert an array of arguments to an argument string.

I'm not certain though, the function doesn't look like it does anything wrong. I think I'll need to set up an environment so I can compile it in order to narrow down where the error occurs.

comment:2 by Frank Mehnert, 9 years ago

Should be now fixed in the latest 4.3.x test builds (>= revision 99851). Could you give it a try?

comment:3 by Jacob Klein, 9 years ago

Question:

I reported on the dev list that Extension installation/updating/removal is now currently broken in the test builds. See: https://www.virtualbox.org/pipermail/vbox-dev/2015-May/013070.html

Is it probable that the solution for this ticket, was the cause of breaking it? The error makes it seem probable, to me. I'm also having the same problem with build 10026.

The installer failed with exit code 1: VBoxExtPackHelperApp.exe: error: argv[0] does not match the executable image path: 'C:Program FilesOracleVirtualBox/VBoxExtPackHelperApp.exe' != 'C:\Program Files\Oracle\VirtualBox\VBoxExtPackHelperApp.exe'.

Can you look into it and reply?

Thanks, Jacob

Last edited 9 years ago by Jacob Klein (previous) (diff)

comment:4 by Jacob Klein, 9 years ago

Regarding my problem, Frank replied with:

thanks for the 'heads-up'. Indeed there was a regression in this build. I've just updated the test builds (100087) which include the fix.

Last edited 9 years ago by Jacob Klein (previous) (diff)

comment:5 by Frank Mehnert, 9 years ago

Resolution: fixed
Status: newclosed

Fix is part o VBox 4.3.28.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use