-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix edge case with doas in multi-user install script #4690
base: master
Are you sure you want to change the base?
Conversation
Sudo uses a barebone shell parser, so we need to prepend `env` to make the environment variables in the commands apply.
$ sudo -h
sudo - execute a command as another user
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
^^^^^^^^^^^
usage: sudo -e [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...
... snip ...
$ sudo env | grep -e HOME -e POTATO_CHIPS
HOME=/Users/abathur
$ sudo HOME=yep POTATO_CHIPS=sure env | grep -e HOME -e POTATO_CHIPS
HOME=yep
POTATO_CHIPS=sure As far as I can tell (but this is a bit fuzzy), this functionality was first released in sudo v1.6.9 on or around July 16 2007. You may need to make a better case for this. Do you have logs demonstrating a failed install? |
I do infact have a failed install because of this, but I don't have logs. I think the culprit might be because I'm using |
Thanks for clarifying. I'm not sure what others will say wrt to whether this is the right approach, but I went ahead and pushed a copy of your branch to my Nix fork to test it out. I ran the new-ish installer tests against it and they came back clean. (This is very new CI functionality--it hasn't really been exercised much yet.) A bonus of running the tests is that they generate a hosted installer you can try out (unless you've already manually fixed up your install?) You can try it by invoking: I can also talk you through setting up the same test/installer-generation yourself if you'd rather not take scripts from a stranger. :) |
You've linked the single-user install script, not the multi-user one. |
Sorry. It just needs the |
When I executed that line, it failed with a hash mismatch -_-. However,
I just appended `--daemon` to an older edit of your comment and ran it,
it worked flawlessly! I think it's ready.
…On ოთხ, აპრ 7, 2021 at 08:14, Travis A. Everett ***@***.***> wrote:
> You've linked the single-user install script, not the multi-user one.
>
Sorry. It just needs the --daemon flag:
sh <(curl
https://abathur-nix-install-tests.cachix.org/serve/sk4r2vpgidqqhdh5gss9flqxbmp11c5n/install)
--daemon --tarball-url-prefix
https://abathur-nix-install-tests.cachix.org/serve
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4690 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ3WNPHTKSP5CLRT4KKG6WDTHRZFPANCNFSM42MNKQDQ>.
|
Any update on getting this merged? |
I'm a little bit concerned about this PR: there is no writing down in the patch about why |
I marked this as stale due to inactivity. → More info |
"Later today" went well. |
I marked this as stale due to inactivity. → More info |
In the multi-user install script, it is assumed that
sudo
can parse environment variable declarations, when it infact cannot whensudo
is provided bydoas
. This pull request fixes this by prependingenv
to the command.