Repository navigation
nixos/wrappers: verify that capabilities strings are valid - #502310
Conversation
8b1ecfe to
04ab390
Compare
aviallon
left a comment
There was a problem hiding this comment.
I love the idea, but, I believe having original source code inside nixpkgs directly is quite uncommon.
Usually, you'd write the program in a dedicated project (which may be adopted by nix-community), and then you package it, and wire it up.
|
No, its not uncommon for original code to exist within nixpkgs if it is small and maintainable enough, especially if the utility outside nixos is basically zero. |
277c883 to
f4b8e82
Compare
|
also failing CI because it wants |
|
As to general approach: We use Alternatively we could attempt to use |
f4b8e82 to
83c5ce0
Compare
83c5ce0 to
9f2dd23
Compare
|
libcap_ng would be nice to avoid C, but agree that the extra complexity of the integration layer is probably not worth it, especially since this C program is quite simple anyway. I do notice that the regular wrapper C src and drv is vendored next to the NixOS module…curious if you think that would be better than exposing in pkgs? |
|
Tbh, exposing |
GrimmTheShrimp
left a comment
There was a problem hiding this comment.
One nit and one small issue (i should have tested my suggestions better), then i am happy
These are likely to differ for many folks, and running these checks should be quite fast (`runCommandLocal` docs suggest anything less than one second should use local).
9f2dd23 to
9d504a2
Compare
This will be used by the `security.wrappers` NixOS module.
Without this, an invalid capabilities string would cause the activation script to fail completely, meaning all wrappers would be missing. This causes unix_chkpwd to be missing, and thus all logins to fail. See NixOS#398934.
9d504a2 to
6b93582
Compare
GrimmTheShrimp
left a comment
There was a problem hiding this comment.
pkgsLLVM.libcap-text-verifier fails because sqlite is broken, not your problem.
Other than that, all the tests i ran on all my stuff seem to indicate this is fine.
| ###### wrappers consistency checks | ||
| system.checks = lib.singleton ( | ||
| pkgs.runCommand "ensure-all-wrappers-paths-exist" | ||
| pkgs.runCommandLocal "ensure-all-wrappers-paths-exist" |
There was a problem hiding this comment.
Actually, one last comment: the name of this drv is nonsensical now
|
Other than that, this seems to work perfectly: Ty :) |
See individual commits for details and elaboration. Fixes #398934.
Not sure the best name for the pkg, or if it would be better inlined in the module (possibly with
writeCBin? though don’t think one can add flags with that…).Things done
nix-build -A nixosTests.wrappers, including manually changing one of the wrapper defs in the test to have a broken capabilities string.passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.