-
-
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
security-wrapper: Don't remove the old paths yet as that can create migration pain #23641
security-wrapper: Don't remove the old paths yet as that can create migration pain #23641
Conversation
What about linking the |
@globin that will not work I think because the wrappers check the dir from which they are being run. |
CC: @teh @domenkozar |
I like it. If this gets merged, we should open an issue for 17.09 not to forget the cleanup. |
Interestingly, I think the initial issue experienced by @bsoudan had to do with the changes introduced prior to my own wrapper work that made the activation script more atomic using tmpfs. Then I believe @qknight and @resonator reporting in #19862, upgrading from 16.09 to master, experienced a similar migration issue to @bsoudan as a result of my own changes in the security wrappers activation script that removes the old wrapper dirs. So, I believe this solves the migration problem from 16.09 to 17.03 with my setcap wrapper changes, but it doesn't resolve @bsoudan's original problem which I think was separate (though, similar in character) to the issue introduced by my own work. I tested this on my EC2 instance by switching to a 16.09 system. Logging out. I checked all the wrappers pointed to the path setup by a 16.09 system, switched the config to my branch, checked I could use |
You've outrun me :) One potential problem is that new sudo and other setuids won't be used with old environment but that's okay I guess. Thanks! |
It definitely is better than the current state. :) |
A small idea which should improve this: let's leave this code but wrap it in |
We should probably merge this for 17.03 |
Yes, It sounded someone was going to improve this but if not I will merge this soon |
@globin, @abbradar's suggestion is good but I haven't taken the time to think it through and the safest option (to me) is to not remove anything across this specific upgrade boundary, so that we reduce possible mistakes, since we don't have any really good automated tests for this. If you disagree with that, I'm open to guidance on what would be the preferred integration path. I will create an issue ticket when you merge this if there aren't additional changes requested. |
Let's just be conservative then; we need this patch in one way or another and this can be improved upon later. |
Fine :) |
I have my version of the patch but I still need to test it extensively; if I'm on time maybe we'll get the cleanup working too. |
Okay, I created issue #24164 tracking cleanup work. |
This makes setuid wrappers not fail after upgrading. references NixOS#23641, NixOS#22914, NixOS#19862, NixOS#16654 (cherry picked from commit e82baf0)
Motivation for this change
As reported in #19862, removing the old wrapper dirs was a bad idea (on me) because users may be using
sudo
tonixos-rebuild switch
which will break afterwards unless the re-source; but it's not intuitive to do that.Leaving the old paths doesn't hurt anything and on their next login, will use the new wrapper paths correctly. The next upgrade, 17.09, can remove these paths from the system safely.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)