mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-22 17:23:06 +00:00
vmtest.vm: quote command arguments from CLI
This fixes commands like `python3 -m vmtest.vm python3 -c 'foo; bar'`. Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
parent
5a8bf55652
commit
219a819659
@ -400,7 +400,11 @@ if __name__ == "__main__":
|
||||
args.root_directory = None
|
||||
|
||||
try:
|
||||
command = " ".join(args.command) if args.command else "sh -i"
|
||||
command = (
|
||||
" ".join([shlex.quote(arg) for arg in args.command])
|
||||
if args.command
|
||||
else "sh -i"
|
||||
)
|
||||
sys.exit(run_in_vm(command, kernel, args.root_directory, args.directory))
|
||||
except LostVMError as e:
|
||||
print("error:", e, file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user