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

modules/vsftpd: Add virtual users support #73300

Merged
merged 1 commit into from
Nov 13, 2019

Conversation

picnoir
Copy link
Member

@picnoir picnoir commented Nov 12, 2019

Motivation for this change

Add a virtual user system based around pam and a Berkeley
user database.

I took advantage of this PR to remove the preStart-based state files management in favor of a native systemd-based one. I can remove this nitpick if necessary. (tested that part manually as well).

Things done

Updated the vsftpd module to provide a pam_db-based auth system for virtual users.

Tested/Using this setup on my personal FTP server.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @peterhoeg @7c6f434c @fpletz (based on latest VSFTPD merged PRs)

Sorry, something went wrong.

@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 12, 2019
@7c6f434c
Copy link
Member

ofBorg:

while evaluating the option `security.pam.services.vsftpd.text':
while evaluating the attribute 'isDefined' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:375:5:
while evaluating the attribute 'values' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:364:9:
while evaluating the attribute 'values' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:458:7:
while evaluating anonymous function at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:350:28, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:350:17:
while evaluating 'dischargeProperties' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:417:25, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:351:62:
while evaluating the attribute 'value' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/lib/modules.nix:234:44:
cannot coerce null to a string, at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-1-lassulus.ewr1.nix.ci/nixos/modules/services/networking/vsftpd.nix:319:41

@picnoir
Copy link
Member Author

picnoir commented Nov 13, 2019 via email

Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

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

Looks good except for the pam service issue you already mentioned.

Add a virtual user system based around pam and a Berkeley
user database.

Adding the:

- localRoot
- userDbPath
- allowWriteableChroot
- virtualUseLocalPrivs

Vsftpd options.
@picnoir picnoir force-pushed the nin-vsftpd-virtusers branch from e86341a to a628f5e Compare November 13, 2019 17:17
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 13, 2019
@picnoir
Copy link
Member Author

picnoir commented Nov 13, 2019

Fixed.

@fpletz fpletz merged commit a6bb97d into NixOS:master Nov 13, 2019
@picnoir picnoir deleted the nin-vsftpd-virtusers branch November 13, 2019 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants