vsftpd: improve default configuration
authorJeremy Lainé <jeremy.laine@m4x.org>
Tue, 23 Dec 2008 05:52:35 +0000 (06:52 +0100)
committerJeremy Lainé <jeremy.laine@m4x.org>
Tue, 23 Dec 2008 05:52:35 +0000 (06:52 +0100)
* restrict anonymous user permissions
* change anonymous ftp directory to /var/lib/ftp
* reindent init script

packages/vsftpd/files/init
packages/vsftpd/files/vsftpd.conf
packages/vsftpd/vsftpd_2.0.5.bb

index f2e40b3..d0ec010 100755 (executable)
@@ -3,7 +3,7 @@ DAEMON=/usr/sbin/vsftpd
 NAME=vsftpd
 DESC="FTP Server"
 ARGS=""
-FTPDIR=/var/tmp/ftp
+FTPDIR=/var/lib/ftp
 
 test -f $DAEMON || exit 0
 
@@ -12,30 +12,30 @@ set -e
 case "$1" in
     start)
         echo -n "* starting $DESC: $NAME... "
-       if ! test -d $FTPDIR; then
-               mkdir -p $FTPDIR/in
-               chown ftp $FTPDIR -R
-               chmod a-w $FTPDIR
-               chmod u+w $FTPDIR/in
-       fi
-       start-stop-daemon -S -b -x $DAEMON -- $ARGS
-       echo "done."
-       ;;
+        if ! test -d $FTPDIR; then
+            mkdir -p $FTPDIR/in
+            chown ftp $FTPDIR -R
+            chmod a-w $FTPDIR
+            chmod u+w $FTPDIR/in
+        fi
+        start-stop-daemon -S -b -x $DAEMON -- $ARGS
+        echo "done."
+        ;;
     stop)
         echo -n "* stopping $DESC: $NAME... "
-       start-stop-daemon -K -x $DAEMON
-       echo "done."
-       ;;
+        start-stop-daemon -K -x $DAEMON
+        echo "done."
+        ;;
     restart)
         echo "* restarting $DESC: $NAME... "
-       $0 stop
-       $0 start
-       echo "done."
-       ;;
+        $0 stop
+        $0 start
+        echo "done."
+        ;;
     *)
-       echo "Usage: $0 {start|stop|restart}"
-       exit 1
-       ;;
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+        ;;
 esac
 
 exit 0
index f6c5b50..08f91e0 100755 (executable)
@@ -27,11 +27,11 @@ write_enable=YES
 # Uncomment this to allow the anonymous FTP user to upload files. This only
 # has an effect if the above global write enable is activated. Also, you will
 # obviously need to create a directory writable by the FTP user.
-anon_upload_enable=YES
+#anon_upload_enable=YES
 #
 # Uncomment this if you want the anonymous FTP user to be able to create
 # new directories.
-anon_mkdir_write_enable=YES
+#anon_mkdir_write_enable=YES
 #
 # Activate directory messages - messages given to remote users when they
 # go into a certain directory.
index fc10d27..0d7c7a1 100644 (file)
@@ -1,7 +1,7 @@
 DESCRIPTION = "Secure ftp daemon"
 SECTION = "console/network"
 LICENSE = "GPL"
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "ftp://vsftpd.beasts.org/users/cevans/vsftpd-${PV}.tar.gz \
            file://makefile.patch;patch=1 \
@@ -36,7 +36,7 @@ do_install() {
 
 pkg_postinst() {
         addgroup ftp
-        adduser --system --home /var/tmp/ftp --no-create-home --ingroup ftp --disabled-password -s /bin/false ftp
+        adduser --system --home /var/lib/ftp --no-create-home --ingroup ftp --disabled-password -s /bin/false ftp
         mkdir -p ${localstatedir}/share/empty
 }