-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
Update from 16.03 to 16.09, problems with /var/setuid-wrappers #19862
Comments
cc @domenkozar |
Did you upgrade to 16.09 with |
Probably, but I couldn't say for sure, the upgrade is definitely long out of my bash history. :( |
I appear to be getting hit by this. $ sudo su -
sudo: /run/current-system/sw/bin/sudo must be owned by uid 0 and have the setuid bit set
$ ls -l /run/current-system/sw/bin/sudo
lrwxrwxrwx 1 root root 66 Jan 1 1970 /run/current-system/sw/bin/sudo -> /nix/store/sgw7jnji7fclpfw7kn049ilrnsrn06x5-sudo-1.8.19p2/bin/sudo
$ ls -l /run/current-system/sw/bin/sudo -L
-r-xr-xr-x 1 root root 149064 Jan 1 1970 /run/current-system/sw/bin/sudo $ /run/booted-system/sw/bin/nixos-version
16.09.1512.6b28bd0 (Flounder)
$ /run/current-system/sw/bin/nixos-version
17.03pre101839.53a2baa (Gorilla) I did run |
Do you still have logs for the upgrade? |
@domenkozar I haven't rebooted the host, is there a specific logfile where this is stored that I could attach for you? |
It's just in the standard output. My hypothesis is, since you use sudo it's not able to run the migration for the wrappers. |
@domenkozar Ah, sorry unfortunately then I do not. I was adding some NFS mounts to my If I look into booting into single user mode and |
Actually now I see that the sudo binary does in fact have the correct permissions. I logged out of the host and logged in again and am now able to $ ls -lL `which sudo`
-r-s--x--x 1 root root 17728 Mar 1 19:11 /run/wrappers/bin/sudo Could it be that my existing shell which ran the |
Ah yes, it probably points to the old |
i've upgraded from
but running a different
using the other binary it is working again as a quick solution! thanks @domenkozar |
@qknight you logout and login again to get |
Minimal test case for a fresh 16.09 system:
@ixmatus cc'ing you in case you have a simple fix in mind, otherwise I'll give it a shot. |
@teh: simply 'source /etc/profile' and your commands should be working. are you using zsh? |
@qknight Using bash. To be clear: I added a test case so we can fix. I also tested running as root wich works as intended. @domenkozar's theory:
seems to be correct - the combination of |
The paths change due to the switch to using /run/wrappers/bin so you need
to log back in to pick up the PATH changes. Does that fix the issue?
How do we communicate this in a upgrade?
|
It would be easiest just to not switch paths. It's more pain than gain
On Wed, Mar 8, 2017, 12:07 Parnell Springmeyer <notifications@github.com>
wrote:
… The paths change due to the switch to using /run/wrappers/bin so you need
to log back in to pick up the PATH changes. Does that fix the issue?
How do we communicate this in a upgrade?
On Wed, Mar 8, 2017, 4:29 AM teh ***@***.***> wrote:
> @qknight <https://github.com/qknight> Using bash. To be clear: I added a
> test case so we can fix. I also tested running as root wich works as
> intended. @domenkozar <https://github.com/domenkozar>'s theory:
>
> It's just in the standard output. My hypothesis is, since you use sudo
> it's not able to run the migration for the wrappers.
>
> seems to be correct - the combination of sudo and switch breaks
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#19862 (comment)>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAB3-gLP1UoKgk2rTDQ3p7rENFJ-LmMAks5rjoMAgaJpZM4KgJEG
>
> .
>
--
Parnell Springmeyer
0xDCCF89258EAD874A
<http://pgp.mit.edu/pks/lookup?op=get&search=0xDCCF89258EAD874A>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19862 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHtg_fEYW8pTD3W7jMK2JOJeXk4wRluks5rjovogaJpZM4KgJEG>
.
|
I originally had kept it that way but was asked to remove the indirection
if the var path.
|
Well that's not entirely true, actually, my original changes even with the
var path would have broken this but it was in an attempt to unify all of
this name things accurately.
|
What if we have a symlink of the old setuid path to this new path??
|
Also, I'd like to provide the fix for this since I should have thought
about the migration path more thoroughly. I can do so in about two hours.
|
I'm actually surprised that the combination of But generally sudo spawns a new shell and on exit it loses the environment changes. I'm not 100% clear that a symlink is the best solution as it's going to hang around after when its no longer needed. |
The more I think about this the I'm leaning towards adding an entry to the release notes for now. re-sourcing In general it'd be useful to have a mechanism that re-sources the environment after a For this specific case we also have a chicken-and-egg problem, because we can't deliver a fix that will arrive in users' open shells before they do the os upgrade. |
I'm available to discuss and work on this. Personally, I don't want to disrupt people's workflows too much but I also fall on the side of just getting this over with since I think it needs to happen. A symlink pointing to the new path isn't too dirty and can be removed after the 17.03 release for the 17.09 release, I think that's fairly reasonable. |
I'm skeptical symlink will work as wrappers assert the path they're being ran from (at least that was the case before the refactoring). |
@domenkozar shoot, you're right. |
In any case, I think |
@domenkozar @teh we can move discussion of how to handle the migration over to #23641. I'm at-minimum removing the code that deletes the old wrapper dirs as that will significantly reduce migration pain I think. I'm testing on my EC2 machine from scratch with some of the actions people reported here. |
@domenkozar thanks for all the help! |
The 17.03 stuff is handled in #23641 |
This makes setuid wrappers not fail after upgrading. references NixOS#23641, NixOS#22914, NixOS#19862, NixOS#16654 (cherry picked from commit e82baf0)
Issue description
I just ran an update from 16.03 to 16.09, and at the end of the update, I noticed this:
Then, in another window, tried a sudo operation but received:
I poked around a bit, and /var/setuid-wrappers looked a bit wacky, it looked like there were too many levels, as if a symlink operation went bad:
I tried running another 'nixos-rebuild switch' operation, and that appeared to fix everything. No errors this time:
I'm worried though if I would have rebooted my system would have been foobar'd, even if I booted into an old system.
The text was updated successfully, but these errors were encountered: