From d47fe14025c27b78e8819e8f0c409b9cce1483b3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 22 Jan 2010 22:36:41 +0100 Subject: proftpd review - prxs is a perl-script, so probably not runnable on the target - add an init-file for the daemon - use a locally saved proftpd.conf (for now only dropped some comments) --- package/proftpd/Makefile | 3 +- package/proftpd/files/proftpd.conf | 60 +++++++++++++++++++++++++++++++++ package/proftpd/files/proftpd.conffiles | 1 + package/proftpd/files/proftpd.init | 30 +++++++++++++++++ package/proftpd/files/proftpd.postinst | 3 ++ 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 package/proftpd/files/proftpd.conf create mode 100644 package/proftpd/files/proftpd.conffiles create mode 100644 package/proftpd/files/proftpd.init create mode 100644 package/proftpd/files/proftpd.postinst (limited to 'package') diff --git a/package/proftpd/Makefile b/package/proftpd/Makefile index c15b649a2..4dcd04eca 100644 --- a/package/proftpd/Makefile +++ b/package/proftpd/Makefile @@ -25,11 +25,10 @@ INSTALL_STYLE:= auto post-install: $(INSTALL_DIR) $(IDIR_PROFTPD)/etc - $(INSTALL_DATA) $(WRKINST)/etc/proftpd.conf $(IDIR_PROFTPD)/etc/ + $(INSTALL_DATA) ./files/proftpd.conf $(IDIR_PROFTPD)/etc/ $(INSTALL_DIR) $(IDIR_PROFTPD)/usr/{s,}bin $(INSTALL_BIN) $(WRKINST)/usr/bin/ftp{count,dctl,top,who} \ $(IDIR_PROFTPD)/usr/bin/ - $(INSTALL_BIN) $(WRKINST)/usr/bin/prxs $(IDIR_PROFTPD)/usr/bin/ $(INSTALL_BIN) $(WRKINST)/usr/sbin/{ftpshut,proftpd} \ $(IDIR_PROFTPD)/usr/sbin/ diff --git a/package/proftpd/files/proftpd.conf b/package/proftpd/files/proftpd.conf new file mode 100644 index 000000000..8d4f7f2fa --- /dev/null +++ b/package/proftpd/files/proftpd.conf @@ -0,0 +1,60 @@ +ServerName "ProFTPD Default Installation" +ServerType standalone +DefaultServer on + +# Port 21 is the standard FTP port. +Port 21 + +# Don't use IPv6 support by default. +UseIPv6 off + +# Umask 022 is a good standard umask to prevent new dirs and files +# from being group and world writable. +Umask 022 + +# To prevent DoS attacks, set the maximum number of child processes +# to 30. If you need to allow more than 30 concurrent connections +# at once, simply increase this value. Note that this ONLY works +# in standalone mode, in inetd mode you should use an inetd server +# that allows you to limit maximum number of processes per service +# (such as xinetd). +MaxInstances 30 + +# Set the user and group under which the server will run. +User nobody +Group nogroup + +# To cause every FTP user to be "jailed" (chrooted) into their home +# directory, uncomment this line. +#DefaultRoot ~ + +# Normally, we want files to be overwriteable. +AllowOverwrite on + +# Bar use of SITE CHMOD by default + + DenyAll + + +# A basic anonymous configuration, no upload directories. If you do not +# want anonymous users, simply delete this entire section. + + User ftp + Group ftp + + # We want clients to be able to login with "anonymous" as well as "ftp" + UserAlias anonymous ftp + + # Limit the maximum number of anonymous logins + MaxClients 10 + + # We want 'welcome.msg' displayed at login, and '.message' displayed + # in each newly chdired directory. + DisplayLogin welcome.msg + DisplayChdir .message + + # Limit WRITE everywhere in the anonymous chroot + + DenyAll + + diff --git a/package/proftpd/files/proftpd.conffiles b/package/proftpd/files/proftpd.conffiles new file mode 100644 index 000000000..9796c366f --- /dev/null +++ b/package/proftpd/files/proftpd.conffiles @@ -0,0 +1 @@ +/etc/proftpd.conf diff --git a/package/proftpd/files/proftpd.init b/package/proftpd/files/proftpd.init new file mode 100644 index 000000000..bf3dc0efe --- /dev/null +++ b/package/proftpd/files/proftpd.init @@ -0,0 +1,30 @@ +#!/bin/sh +#PKG proftpd +#INIT 60 + +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${proftpd:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + [ -f /etc/proftpd.conf ] || exit + proftpd + ;; +stop) + pkill proftpd + ;; +restart) + sh $0 stop + sleep 1 + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + exit 1 + ;; +esac +exit $? diff --git a/package/proftpd/files/proftpd.postinst b/package/proftpd/files/proftpd.postinst new file mode 100644 index 000000000..0b3fa08aa --- /dev/null +++ b/package/proftpd/files/proftpd.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf proftpd proftpd NO -- cgit v1.2.3