-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
nixos/nextcloud: Remove --preserve-env in sudo #321771
Conversation
Ping @Ma27 @SuperSandro2000 |
Would be fine by me. |
It seems to break the
It also broke on system activation after cherry-picking the PR into my nixpkgs fork. I try to take a deeper look later when I am at a desktop machine |
To be clear, I agree with the idea, I haven't taken a close look whether the new invocation is actually correct currently 😁 |
From my side all good 😊, I am also the option that it's a nice idea to keep compatible with sudo-rs if possible, so I wanted to test it out. Wrapper invocation for non nextcloud users work fine. |
Wouldn't this expose the pass env in the exec args and be displayed in programs like htop? Why can't they implement this simple feature? This could be done in a few lines shell script. |
Dammit, I forgot about OC_PASS. However, is there any reason this even exists? Just checked the sources and it's only used for adding a user or resetting someone's password, however other alternatives are also OK. Can't remember having it used a single time. |
To make it compatible with the
or
Tho in case we keep OC_PASS , we should not expose it. OC_PASS is used for |
Just want to mention here that if this suggestion is to be some kind of ensure*-style option, then it isn't declarative and I'm strongly against adding it to this module. See also #248334 If the VM tests still pass with OC_PASS removed (i.e. installing Nextcloud still works without it), I'd suggest to just drop it. |
yeah, then we should remove it, totally agreeing from my end. |
b753d6e
to
3d83b89
Compare
Alright, I tested this PR on my server. Directly setting env variables as the first attempt tried is also not implemented ( I didn't think about |
@ofborg test nextcloud |
This helps supporting sudo-rs, which currently does not implement the --preserve-env flag and probably won't so in the foreseeable future [1]. The replacement just sets both environment variables behind the sudo invocation with env, as sudo-rs also doesn't implement env var lists. The OC_PASS variable is dropped, as it is seemingly unused and would leak through this approach through /proc. [1] trifectatechfoundation/sudo-rs#129
3d83b89
to
af072cf
Compare
Description of changes
This helps supporting sudo-rs, which currently does not implement the --preserve-env flag and probably won't so in the foreseeable future [1].
The replacement just sets both environment variables behind the sudo invocation, which works with exec and both sudo implementations.
[1] trifectatechfoundation/sudo-rs#129
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.