-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Fixup various setuid/setgid permission problems, part 2 #26939
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
Conversation
Looks like NixOS creates a security wrapper for this already, FWIW.
@@ -27,7 +27,7 @@ stdenv.mkDerivation { | |||
''; | |||
|
|||
preBuild = '' | |||
sed -e "s@/etc/@$out/etc/@g" -i Makefile | |||
sed -e "s@/etc/@$out/etc/@g" -e "/chmod u+s/d" -i Makefile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like differential rights management, so perhaps you could replace that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change deletes the entire chmod u+s
invocation entirely, which seems even better! (yes?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I am sorry for wasting your time here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see some additional context in some comments about why the original package does things in a different way (i.e. with permission structures with 4 numbers) and how changing this on all platforms won't break things.
@0xABAB thanks for the review and comments. See #26600 for a bit of background, but basically for security reasons Nix no longer allows builders to set various permissions at any point during the build. Previously builders could "pretend" to set things like These changes should not change permissions on the completed outputs. The goal is to prevent security holes on builders that allow this behavior and un-break the build on hosts using newer Nix that disallows setting these permissions even temporarily. Separately from working towards ensuring we're on the same page (above), is there something to be done to improve on these changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very happy with how this was handled.
Built locally. Thank you |
Thanks for merging! 👍 |
Motivation for this change
Fixes all but the Darwin-specific failure in qtsvg from the list of packages in #26600.
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/
)