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/pmount: add pmount programs module #51406

Closed
wants to merge 1 commit into from

Conversation

Gerschtli
Copy link
Contributor

Motivation for this change

Add pmount module with setuid wrapper.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@matthewbauer
Copy link
Member

matthewbauer commented Dec 2, 2018

Shouldn't users set security.wrappers themselves? It's not clearly documented what is going on behind the scenes here. This looks like it will let anyone use pmount as root. See #50480 for why we should try to avoid this.

Anyway, why can't we just use udiskctl? It should do the same thing without the SUID bit.

@Gerschtli
Copy link
Contributor Author

I see your point, but without the security wrapper, pmount wouldn't work correctly. So either way, the documentation should clearly state, that such a wrapper is mandatory.

I didn't know udiskctl, will check it out!

pumount.source = "${pkgs.pmount.out}/bin/pumount";
};

system.activationScripts.pmount = "mkdir -p /media";
Copy link
Member

Choose a reason for hiding this comment

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

I presume pmount does not create /media on its own? Personally, I prefer using a tmpfiles rule or maybe even a tmpfs for this. But it may be better to leave it up to the user in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's probably too restrictive and needs more flexibilty..

@Gerschtli
Copy link
Contributor Author

Closing this issue because the module assumes to much of what the user wants, isn't documented enough. If anyone wants to contribute an modified version of this module, feel free to do so, but I am going to use udiskctl which seems to be the better choice (no need of setuid).

Thank you both for your input though!

@Gerschtli Gerschtli closed this Dec 3, 2018
@Gerschtli Gerschtli deleted the add/programs-pmount branch December 3, 2018 17:45
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