Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression] Multipass exec command does not work with "" #3119

Closed
albertlorente-aimsun opened this issue Jun 12, 2023 · 6 comments · Fixed by #3117
Closed

[regression] Multipass exec command does not work with "" #3119

albertlorente-aimsun opened this issue Jun 12, 2023 · 6 comments · Fixed by #3117
Assignees
Labels
Milestone

Comments

@albertlorente-aimsun
Copy link

albertlorente-aimsun commented Jun 12, 2023

Describe the bug
Before the 1.12.0 version I can execute this command without problems:

multipass exec test -- ssh-keygen -b 2048 -t ed25519 -f /home/ubuntu/.ssh/id_rsa -N '' -q

But with the last update, all after '' are not executed (the '' either). If I run the command inside the multipass instance, it works fine!

The command does not work because the answer is: "option requires an argument -- N"

To Reproduce
How, and what happened?

  1. Try to execute multipass exec test -- ssh-keygen -b 2048 -t ed25519 -f /home/ubuntu/.ssh/id_rsa -N '' -q and see that the -q option is not take in care

Additional info

  • OS:
    Ubuntu 18.04

  • multipass version
    multipass 1.12.0
    multipassd 1.12.0

  • multipass info --all
    Name: test
    State: Running
    IPv4: 10.56.33.196
    Release: Ubuntu 18.04.6 LTS
    Image hash: 8dd2e6b5e5aa (Ubuntu 18.04 LTS)
    CPU(s): 5
    Load: 0.00 0.03 0.02
    Disk usage: 1.2GiB out of 29.0GiB
    Memory usage: 130.9MiB out of 15.7GiB
    Mounts: --

  • multipass get local.driver
    qemu

@luis4a0
Copy link
Contributor

luis4a0 commented Jun 12, 2023

Hi @albertlorente-aimsun, I am not able to reproduce your bug. Executing the command you mentioned in Multipass 1.12.0 on Linux, with the qemu driver, on a 18.04.6 instance is working for me. Can you specify what shell are you using, in the host and in the instance? Thanks!

@luis4a0
Copy link
Contributor

luis4a0 commented Jun 12, 2023

@albertlorente-aimsun Another thing: you mention in the title that the issue is about double quotes, and also use double quotes in the description of the bug after the command-line you execute. Can you please clarify where are the double quotes in the command? Thanks!

@albertlorente-aimsun
Copy link
Author

Hi Luis! Sorry for the bad explanation. Here I attach some snapshots to explain the bug more accurancy

The spec of the machine are:
image

Then, if I run the following command, you can see that the -q option is not take in care (appear some text in the terminal). The "" of the -N argument either
multipass exec test-machine -- ssh-keygen -b 2048 -t ed25519 -f /home/ubuntu/.ssh/id_rsa -N "" -q
image

But, if I set a passphrase (-N) like "QA", then the -q option works fine
multipass exec test-machine -- ssh-keygen -b 2048 -t ed25519 -f /home/ubuntu/.ssh/id_rsa -N "QA" -q
image

@luis4a0
Copy link
Contributor

luis4a0 commented Jun 13, 2023

Hi @albertlorente-aimsun, thanks a lot for clarifying! This gives us a much better idea of what's happening and we are aiming to provide a fix for this as soon as possible.

@townsend2010 townsend2010 changed the title Multipass exec command does not work with "" [regression] Multipass exec command does not work with "" Jun 13, 2023
@townsend2010 townsend2010 added this to the 1.12.1 milestone Jun 13, 2023
@luis4a0 luis4a0 added high high importance regression labels Jun 13, 2023
@albertlorente-aimsun
Copy link
Author

albertlorente-aimsun commented Jun 13, 2023

Hi Luis! one question, can I return to the RC version? I've tried to remove multipass 1.12.0 and install again with snap install multipass --beta but 1.12.0 version is installed. Thanks!

@luis4a0
Copy link
Contributor

luis4a0 commented Jun 13, 2023

@albertlorente-aimsun All the snap channels are set to retrieve Multipass 1.12.0. You can try with snap revert multipass to go back to the previously installed version.

luis4a0 added a commit that referenced this issue Jun 13, 2023
bors bot added a commit that referenced this issue Jun 14, 2023
3117: Fix newlines and empty strings which go through SSH r=townsend2010 a=luis4a0

This fixes #3116, the execution of strings containing quotes and newlines, like `multipass exec instance -- bash -c 'blah\nblah'`.

This also fixes #3119, the execution of strings containing empty substrings delimited with single or double quotes.

Co-authored-by: Luis Peñaranda <[email protected]>
bors bot added a commit that referenced this issue Jun 15, 2023
3117: Fix newlines and empty strings which go through SSH r=townsend2010 a=luis4a0

This fixes #3116, the execution of strings containing quotes and newlines, like `multipass exec instance -- bash -c 'blah\nblah'`.

This also fixes #3119, the execution of strings containing empty substrings delimited with single or double quotes.

Co-authored-by: Luis Peñaranda <[email protected]>
bors bot added a commit that referenced this issue Jun 15, 2023
3117: Fix newlines and empty strings which go through SSH r=townsend2010 a=luis4a0

This fixes #3116, the execution of strings containing quotes and newlines, like `multipass exec instance -- bash -c 'blah\nblah'`.

This also fixes #3119, the execution of strings containing empty substrings delimited with single or double quotes.

Co-authored-by: Luis Peñaranda <[email protected]>
bors bot added a commit that referenced this issue Jun 15, 2023
3117: Fix newlines and empty strings which go through SSH r=townsend2010 a=luis4a0

This fixes #3116, the execution of strings containing quotes and newlines, like `multipass exec instance -- bash -c 'blah\nblah'`.

This also fixes #3119, the execution of strings containing empty substrings delimited with single or double quotes.

Co-authored-by: Luis Peñaranda <[email protected]>
@bors bors bot closed this as completed in a6db100 Jun 16, 2023
townsend2010 pushed a commit that referenced this issue Jun 16, 2023
3117: Fix newlines and empty strings which go through SSH r=townsend2010 a=luis4a0

This fixes #3116, the execution of strings containing quotes and newlines, like `multipass exec instance -- bash -c 'blah\nblah'`.

This also fixes #3119, the execution of strings containing empty substrings delimited with single or double quotes.

Co-authored-by: Luis Peñaranda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants