-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
qrexec-agent does not correctly set $PATH variable for root user who has fish as default shell #3434
Comments
What template you use there (by default it's fedora-25, have you changed that?)? |
hi, I made a new sys-net hoping I wouldn't get the "mac address already in use" because I have to restart my computer every time I want to restart sys-net, but in this new one this problem is still the same. What I did:
I installed fedora 26 because I like to keep things up to date and because it was available from qubes, I thought I might at least try it. Ok, I tested with a stock fedora-25. The path is correct. 3 differences with the other one:
I will narrow it down. |
Ok, after setting fish shell to the root user default shell the path no longer has /usr/sbin. I wonder whether this is a problem on the fish end or the qubes end, but in any case when logging in interactively on the terminal, sbin is in the path, but when called through qvm-run it isn't. |
Yes, it may be a problem with fish. We expect that a login shell load appropriate startup scripts and setup environment. This especially include |
what I propose it to set this to priority minor, as it's not a very common setup and it can be worked around easily by using 'sudo fish' interactively, leaving the default shell to bash.
I will try to look into this a bit further. If it is fish's fault for not setting up the environment than I will file an issue there, although it works on interactive tty, I have not yet figured out how fish sets up the environment exactly.
The bigger problem here is that the breakage is unexpected and not trivial to debug, so if the problem is not on the fish end, say if this might break also on other shells like zsh, it would probably be good to mention in the docs for template VM's or AppVM that setting other default shells for root might break things.
|
Resetting my default shell to /bin/bash has also magically fixed other things:
so yeah, documenting this might avoid some future problems for other users. |
btw I would also propose to take it off the 4.0 milestone |
Tested with Debian (shown above), and Fedora(29/30) based templates in Qubes 4.0. @andrewdavidwong Please close as Fixed. |
Qubes OS version:
R4.0
Affected TemplateVMs:
sys-net
Steps to reproduce the behavior:
qvm-run -p -u root sys-net 'env'
Expected behavior:
PATH should include
/sbin
and/usr/sbin
for root.Actual behavior:
PATH doesn't have
/sbin
and/usr/sbin
General notes:
The security impact should be minor. This does keep privileged processes from working correctly though.
The problem breaks functionality like SuspendPre because
prepare-suspend
useslsmod
and other commands that are in/sbin
.Solution
I'm not sure how this is best resolved. I'm not sure if the best option is to have an environment identical to when one logs into a interactive shell, because that implies parsing shell specific files like .bashrc or config.fish, ...
A consideration to make is that the user might have different shells installed, and so remote commands should never assume bash or sh, or should invoke the correct shell explicitly. I have not looked through qubes rpc code, but I just figured that is a possible source of bugs for people who use different shells. Maybe that could be documented in the qrexec documentation.
Workaround
For fixing suspend for the wifi card with a quick hack, one can add:
PATH=/sbin:/usr/sbin:$PATH
at the beginning of:/usr/lib/qubes/prepare-suspend
in the template forsys-net
.Related issues:
qrexec-agent do not setup process environment correctly - #3416
wireless does not automatically reconnect on resume on R4-rc1 - #3151
The text was updated successfully, but these errors were encountered: