forked from mirrors/nixpkgs
Fixing vsftpd without anonymous users, adding localUsers, and creating chroot path.
svn path=/nixos/trunk/; revision=14286
This commit is contained in:
parent
51078ac5b7
commit
632d77806f
|
@ -1847,6 +1847,13 @@ in
|
|||
";
|
||||
};
|
||||
|
||||
localUsers = mkOption {
|
||||
default = false;
|
||||
description = "
|
||||
Whether to enable FTP for the local users.
|
||||
";
|
||||
};
|
||||
|
||||
writeEnable = mkOption {
|
||||
default = false;
|
||||
description = "
|
||||
|
|
|
@ -308,7 +308,7 @@ let
|
|||
++ optional config.services.vsftpd.enable
|
||||
(import ../upstart-jobs/vsftpd.nix {
|
||||
inherit (pkgs) vsftpd;
|
||||
inherit (config.services.vsftpd) anonymousUser
|
||||
inherit (config.services.vsftpd) anonymousUser localUsers
|
||||
writeEnable anonymousUploadEnable anonymousMkdirEnable;
|
||||
})
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ vsftpd, anonymousUser
|
||||
{ vsftpd, anonymousUser, localUsers
|
||||
, anonymousUploadEnable, anonymousMkdirEnable, writeEnable
|
||||
}:
|
||||
|
||||
|
@ -42,6 +42,13 @@ start script
|
|||
"anonymous_enable=YES"
|
||||
else
|
||||
"anonymous_enable=NO") +
|
||||
(if localUsers then
|
||||
"
|
||||
local_enable=YES"
|
||||
else
|
||||
"
|
||||
local_enable=NO"
|
||||
) +
|
||||
(if writeEnable then
|
||||
"
|
||||
write_enable=YES"
|
||||
|
@ -70,8 +77,16 @@ nopriv_user=vsftpd
|
|||
secure_chroot_dir=/var/ftp/empty
|
||||
EOF
|
||||
|
||||
" +
|
||||
(if anonymousUser then
|
||||
"
|
||||
mkdir -p /home/ftp &&
|
||||
chown -R ftp:ftp /home/ftp
|
||||
"
|
||||
else "") +
|
||||
"
|
||||
mkdir -p /var/ftp/empty &&
|
||||
chown vsftpd /var/ftp/empty
|
||||
end script
|
||||
|
||||
respawn ${vsftpd}/sbin/vsftpd /etc/vsftpd.conf
|
||||
|
|
Loading…
Reference in a new issue