ports/85969: ftp/pure-ftpd doesn't support upload script
dawnshade
h-k at mail.ru
Sun Sep 11 09:20:04 UTC 2005
>Number: 85969
>Category: ports
>Synopsis: ftp/pure-ftpd doesn't support upload script
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Sep 11 09:20:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: dawnshade
>Release: 5.4-RELEASE
>Organization:
-
>Environment:
FreeBSD serv.*.ru 5.4-RELEASE-p3 FreeBSD 5.4-RELEASE-p3 #0: Mon Jul 4 19:06:03 MSD 2005 root at serv.*.ru:/usr/obj/usr/src/sys/9 i386
>Description:
/usr/ports/ftp/pure-ftpd doesn't support lauching upload script daemon, as documented at start page http://pureftpd.org:
"- Any external shell script can be called after a successful upload. Virus scanners and database archiveal can easily be set up."
Please, fix (if wrong) my poor english in pkg-message file.
>How-To-Repeat:
Install from /usr/ports/ftp/pure-ftpd and try configure upload script
>Fix:
diff -ruN pure-ftpd.old pure-ftpd
diff -ruN pure-ftpd.old/Makefile pure-ftpd/Makefile
--- pure-ftpd.old/Makefile Sun Sep 11 10:50:12 2005
+++ pure-ftpd/Makefile Sun Sep 11 13:10:12 2005
@@ -7,7 +7,7 @@
PORTNAME= pure-ftpd
PORTVERSION= 1.0.20
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= ftp ipv6
MASTER_SITES= ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \
ftp://ftp2.fr.pureftpd.org/pub/mirrors/ftp.fr.pureftpd.org/pub/pure-ftpd/releases/ \
@@ -33,7 +33,7 @@
--with-virtualchroot \
--with-tls \
--with-largefile \
- --sysconfdir=${PREFIX}/etc
+ --sysconfdir=${PREFIX}/etc
MAN8= pure-ftpd.8 pure-ftpwho.8 pure-mrtginfo.8 pure-statsdecode.8 \
pure-uploadscript.8 pure-pw.8 pure-pwconvert.8 pure-quotacheck.8 \
@@ -46,7 +46,8 @@
PRIVSEP "Enable privilege separation" off \
PERUSERLIMITS "Per-user concurrency limits" off \
THROTTLING "Bandwidth throttling" off \
- BANNER "Show ${PORTNAME} welcome upon session start" on
+ BANNER "Show ${PORTNAME} welcome upon session start" on \
+ UPLOADSCRIPT "Support uploadscript daemon" off
.include <bsd.port.pre.mk>
@@ -103,6 +104,11 @@
CONFIGURE_ARGS+= --without-banner
.endif
+# support uploadscript?
+.if defined (UPLOADSCRIPT)
+CONFIGURE_ARGS+= --with-uploadscript
+.endif
+
.if ${OSVERSION} > 500000
PAM_TEMPL?= ${FILESDIR}/pam.conf.5
.else
@@ -115,6 +121,8 @@
PAM_TARGET?= pure-ftpd
.endif
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
DOCS= AUTHORS CONTACT COPYING HISTORY NEWS \
README README.Configuration-File README.Contrib README.LDAP \
README.Netfilter README.MySQL README.PGSQL README.Virtual-Users \
@@ -158,5 +166,6 @@
@${ECHO_MSG} "Now you need to examine ${PAM_DIR}/${PAM_TARGET}"
@${ECHO_MSG} "and add the relevant PAM configuration lines to your /etc/pam.conf file."
.endif
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff -ruN pure-ftpd.old/files/pure-ftpd.sh.sample pure-ftpd/files/pure-ftpd.sh.sample
--- pure-ftpd.old/files/pure-ftpd.sh.sample Tue Nov 23 13:32:19 2004
+++ pure-ftpd/files/pure-ftpd.sh.sample Sun Sep 11 13:05:59 2005
@@ -10,6 +10,10 @@
#
# pureftpd_enable="YES"
#
+# For launch uploadscript daemon define
+# pureftpd_upload_enable="YES"
+# pureftpd_uploadscript="/full/path/to/launch_script"
+#
. %%RC_SUBR%%
@@ -19,12 +23,42 @@
load_rc_config $name
command=%%PREFIX%%/sbin/pure-config.pl
+command_upload=%%PREFIX%%/sbin/pure-uploadscript
+pureftpd_uploadscript=${pureftpd_uploadscript:-"/usr/bin/touch"}
pureftpd_config=${pureftpd_config:-"%%PREFIX%%/etc/pure-ftpd.conf"}
required_files=${pureftpd_config}
pidfile=/var/run/pure-ftpd.pid
+pidfile2=/var/run/pure-uploadscript.pid
procname=pure-ftpd
pureftpd_enable=${pureftpd_enable:-"NO"}
command_args=${pureftpd_config}
+command_upload_args="-B -r ${pureftpd_uploadscript}"
+
+start_postcmd=start_postcmd
+stop_postcmd=stop_postcmd
+
+start_postcmd()
+{
+ if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then
+ echo "Starting ${command_upload}."
+ ${command_upload} ${command_upload_args}
+ fi
+}
+
+stop_postcmd()
+{
+ if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then
+ pid=$(check_pidfile ${pidfile2} ${command_upload})
+ if [ -z ${pid} ]; then
+ echo "Upload script not running? (check ${pidfile2})."
+ return 1
+ fi
+ echo "Stopping ${command_upload}."
+ kill -${sig_stop:-TERM} ${pid}
+ [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
+ wait_for_pids ${pid}
+ fi
+}
run_rc_command "$1"
diff -ruN pure-ftpd.old/pkg-message pure-ftpd/pkg-message
--- pure-ftpd.old/pkg-message Thu Jan 1 03:00:00 1970
+++ pure-ftpd/pkg-message Sun Sep 11 12:47:32 2005
@@ -0,0 +1,5 @@
+
+If you defined call upload script in pure-ftpd config
+define corresponding vars in rc.conf
+Without it pure-ftpd will not listen tcp socket - see
+FAQ: http://pureftpd.org/FAQ
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list