Fixing vsftpd without anonymous users, adding localUsers, and creating chroot path.

svn path=/nixos/trunk/; revision=14286
This commit is contained in:
Lluís Batlle i Rossell 2009-02-28 20:01:49 +00:00
parent 51078ac5b7
commit 632d77806f
3 changed files with 24 additions and 2 deletions

View File

@ -1847,6 +1847,13 @@ in
";
};
localUsers = mkOption {
default = false;
description = "
Whether to enable FTP for the local users.
";
};
writeEnable = mkOption {
default = false;
description = "

View File

@ -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;
})

View File

@ -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