From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Sep 11 09:20:04 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5EB0816A41F for ; Sun, 11 Sep 2005 09:20:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA2AB43D48 for ; Sun, 11 Sep 2005 09:20:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8B9K3Os033008 for ; Sun, 11 Sep 2005 09:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8B9K3kP033007; Sun, 11 Sep 2005 09:20:03 GMT (envelope-from gnats) Resent-Date: Sun, 11 Sep 2005 09:20:03 GMT Resent-Message-Id: <200509110920.j8B9K3kP033007@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, dawnshade Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C21DB16A41F for ; Sun, 11 Sep 2005 09:20:01 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 844B043D45 for ; Sun, 11 Sep 2005 09:20:01 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j8B9K1Oa019951 for ; Sun, 11 Sep 2005 09:20:01 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j8B9K17e019934; Sun, 11 Sep 2005 09:20:01 GMT (envelope-from nobody) Message-Id: <200509110920.j8B9K17e019934@www.freebsd.org> Date: Sun, 11 Sep 2005 09:20:01 GMT From: dawnshade To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/85969: ftp/pure-ftpd doesn't support upload script X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Sep 2005 09:20:04 -0000 >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@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 @@ -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 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: