Skip to content
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/ckb: Add option to restrict access to the devices to a particu... #34064

Closed
wants to merge 1 commit into from

Conversation

Nadrieril
Copy link
Contributor

…ar group

Motivation for this change

By default, the ckb daemon allows acces to its controlling socket to any process (chmod 666), which is kinda crazy. This PR allows to restrict access to a unix group.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@kierdavis kierdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature itself works; however I have a niggle about the metadata of the new option (see line comment).

@@ -10,6 +10,15 @@ in
options.hardware.ckb = {
enable = mkEnableOption "the Corsair keyboard/mouse driver";

gid = mkOption {
type = types.nullOr types.str;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that ckb-daemon only accepts actual GIDs and not group names, so please could we change the type of this option to types.int and update the example to reflect this?

@Nadrieril
Copy link
Contributor Author

You're right, I changed that. Thanks for the fast feedback !

Copy link
Contributor

@kierdavis kierdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looks good to me now.

@Mic92
Copy link
Member

Mic92 commented Nov 15, 2018

merged in 99a8c45

@Mic92 Mic92 closed this Nov 15, 2018
Mic92 pushed a commit that referenced this pull request Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants