-
Notifications
You must be signed in to change notification settings - Fork 670
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
multipass exec
yields unexpected result when command invoked uses sudo
#3933
Comments
Hey @jnsgruk, We've been able to reproduce this issue and have identified the cause. It appears that when the home directory ( Minimal Reproducible ExampleThis fails (produces incorrect
|
Concierge itself has no requirement for any mounts 😃 I have that example as it was what was reported by @omar-selo - I'm sure he'll appreciate knowing this workaround while you look into the cause 😃 Thank you! |
Thank you for looking into this @levkropp & @jnsgruk. I've tested the workaround and found that we missed something. Specifically, the issue does not occur when the mounted directory is the home directory. Instead, it occurs when the mounted directory is
Which will output:
|
Ah looks like I was wrong. The issue is yet something else. If you run For instance:
|
Well spotted @omar-selo. So this is being caused by the directory mapping. If I just opt out of that, I don't get the issue any more:
|
Describe the bug
If I run a command with
multipass exec
that involvessudo
, theSUDO_
environemnt variables inside the machine are not as I would expectTo Reproduce
Expected behavior
I would expect the
SUDO_USER
to be set toubuntu
,SUDO_UID
to1000
, etc. Ifmultipass shell
is used, that is the case:Logs
Please provide logs from the daemon, see accessing logs on where to find them on your platform.
Additional info
multipass version
: 1.15.0multipass info
:multipass get local.driver
:qemu
Additional context
First reported here: jnsgruk/concierge#37
cc @omar-selo
The text was updated successfully, but these errors were encountered: