The /usr/local/etc/rc.d/pure-ftpd not contains any support for pure-authd, the external authentication agent of pure-ftpd. Fix: I added few lines to rc.d/pure-ftpd, see the attached diff file. Patch attached with submission follows: How-To-Repeat: Install the package. My version is pure-ftpd-1.0.34.
Responsible Changed From-To: freebsd-ports-bugs->garga Fix synopsis and assign.
State Changed From-To: open->feedback Could you please provide a patch to apply to /usr/ports/ftp/pure-ftpd/files/pure-ftpd.sh.in instead of installed file?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello Gabor, Sorry for the long delay to answer. The only part of the patch i don't agree is the following line: pureftpd_authsocket=`grep ^ExtAuth /usr/local/etc/pure-ftpd.conf | sed s/^ExtAuth[\ \t]*//` I believe it's not a "safe" way to do it, it's fragile and easy to be broken. Could you please try to find a diferent way to get authsocket information? Regards - -- Renato Botelho <garga @ FreeBSD.org> <garga @ freebsdbrasil.com.br> GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc To laugh at men of sense is the privilege of fools. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (Darwin) iEYEARECAAYFAk9ly24ACgkQ6CRbiSJE7andkACgm7iEePT4c2hnWdKxT3pT7/Iu 9zwAoIiomt9FiaqHkOlCPe9PY/ItgpgE =uJYO -----END PGP SIGNATURE-----
On 3/18/2012 12:48 PM, Renato Botelho wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello Gabor, > > Sorry for the long delay to answer. > > The only part of the patch i don't agree is the following line: > > pureftpd_authsocket=`grep ^ExtAuth /usr/local/etc/pure-ftpd.conf | sed s/^ExtAuth[\ \t]*//` > > I believe it's not a "safe" way to do it, it's fragile and easy to be > broken. > > Could you please try to find a diferent way to get authsocket > information? > Hi! Please, inform me, which part isn't safe? The next concept is better? exec 9>&0 <pure-ftpd.conf while read key value do test "${key}" = "ExtAuth" && break done exec 0>&9 0>&- Regards
Responsible Changed From-To: garga->freebsd-ports-bugs Back this PR to the pool. I'm not maintainer of this port anymore and don't have time to deal with it properly.
State Changed From-To: feedback->closed Feedback Timeout
State Changed From-To: closed->open Re-open per the submitter's request.
Responsible Changed From-To: freebsd-ports-bugs->sunpoet Over to the new maintainer.
Author: sunpoet Date: Mon Mar 31 14:12:42 2014 New Revision: 349753 URL: http://svnweb.freebsd.org/changeset/ports/349753 QAT: https://qat.redports.org/buildarchive/r349753/ Log: - Add pure-authd support in rc script [1][2] - Indent rc script - Cosmetic change - Bump PORTREVISION for package change PR: ports/163339 [1], ports/180992 [2] (based on) Submitted by: Gabor HALASZ <halasz.g@freemail.hu> [1] Ari Maniatis <ari@ish.com.au> [2] Added: head/ftp/pure-ftpd/files/pure-alwaysfail (contents, props changed) Modified: head/ftp/pure-ftpd/Makefile head/ftp/pure-ftpd/files/pure-ftpd.in head/ftp/pure-ftpd/pkg-plist Modified: head/ftp/pure-ftpd/Makefile ============================================================================== --- head/ftp/pure-ftpd/Makefile Mon Mar 31 14:08:09 2014 (r349752) +++ head/ftp/pure-ftpd/Makefile Mon Mar 31 14:12:42 2014 (r349753) @@ -3,6 +3,7 @@ PORTNAME= pure-ftpd PORTVERSION= 1.0.36 +PORTREVISION= 1 CATEGORIES= ftp ipv6 MASTER_SITES= http://download.pureftpd.org/pub/pure-ftpd/releases/ \ ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \ @@ -105,6 +106,7 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/pureftpd-pgsql.conf ${STAGEDIR}${PREFIX}/etc/pureftpd-pgsql.conf.sample ${INSTALL_DATA} ${WRKSRC}/configuration-file/pure-ftpd.conf ${STAGEDIR}${PREFIX}/etc/pure-ftpd.conf.sample ${INSTALL_SCRIPT} ${WRKSRC}/configuration-file/pure-config.pl ${STAGEDIR}${PREFIX}/sbin/ + ${INSTALL_SCRIPT} ${FILESDIR}/pure-alwaysfail ${STAGEDIR}${PREFIX}/sbin/ ${MKDIR} ${STAGEDIR}${DOCSDIR}/ cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ Added: head/ftp/pure-ftpd/files/pure-alwaysfail ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ftp/pure-ftpd/files/pure-alwaysfail Mon Mar 31 14:12:42 2014 (r349753) @@ -0,0 +1,4 @@ +#!/bin/sh + +echo auth_ok:0 +echo end Modified: head/ftp/pure-ftpd/files/pure-ftpd.in ============================================================================== --- head/ftp/pure-ftpd/files/pure-ftpd.in Mon Mar 31 14:08:09 2014 (r349752) +++ head/ftp/pure-ftpd/files/pure-ftpd.in Mon Mar 31 14:12:42 2014 (r349753) @@ -1,19 +1,26 @@ #!/bin/sh - +# # $FreeBSD$ # + # PROVIDE: pureftpd # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON # KEYWORD: shutdown -# + # Add the following lines to /etc/rc.conf to enable pure-ftpd: # -# pureftpd_enable="YES" +# pureftpd_enable="yes" +# +# Add the following lines to /etc/rc.conf to enable pure-authd daemon: # -# For launch uploadscript daemon define -# pureftpd_upload_enable="YES" -# pureftpd_uploadscript="/full/path/to/launch_script" +# pureftpd_authd_enable="yes" +# pureftpd_authdscript="/full/path/to/auth_script" +# +# Add the following lines to /etc/rc.conf to enable uploadscript daemon: +# +# pureftpd_upload_enable="yes" +# pureftpd_uploadscript="/full/path/to/upload_script" . /etc/rc.subr @@ -23,42 +30,68 @@ rcvar=pureftpd_enable 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} +command_args="${pureftpd_config} -g${pidfile}" pidfile=/var/run/pure-ftpd.pid -pidfile2=/var/run/pure-uploadscript.pid procname=pure-ftpd - -pureftpd_enable=${pureftpd_enable:-"NO"} -command_args="${pureftpd_config} -g${pidfile}" +pureftpd_config=${pureftpd_config:-"%%PREFIX%%/etc/pure-ftpd.conf"} +pureftpd_enable=${pureftpd_enable:-"no"} +required_files=${pureftpd_config} +# authd +command_authd=%%PREFIX%%/sbin/pure-authd +command_authd_args="-B -r ${pureftpd_authdscript} -s ${pureftpd_authsocket}" +pidfile_authd=/var/run/pure-authd.pid +pureftpd_authdscript=${pureftpd_authdscript:-"%%PREFIX%%/sbin/pure-alwaysfail"} +pureftpd_authsocket=`%%PREFIX%%/sbin/pure-config.pl ${pureftpd_config} | grep -o ' -lextauth:[^ ]*' | cut -d: -f2` +# uploadscript +command_upload=%%PREFIX%%/sbin/pure-uploadscript command_upload_args="-B -r ${pureftpd_uploadscript}" +pidfile_uploadscript=/var/run/pure-uploadscript.pid +pureftpd_uploadscript=${pureftpd_uploadscript:-"/usr/bin/touch"} +start_precmd=start_precmd start_postcmd=start_postcmd stop_postcmd=stop_postcmd +start_precmd() +{ + if test -n ${pureftpd_authd_enable:-""} && checkyesno pureftpd_authd_enable && test -x ${pureftpd_authdscript}; then + echo "Starting ${command_authd}." + ${command_authd} ${command_authd_args} + fi +} + start_postcmd() { - if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then - echo "Starting ${command_upload}." - ${command_upload} ${command_upload_args} - fi + 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 + if test -n ${pureftpd_authd_enable:-""} && checkyesno pureftpd_authd_enable; then + pid=$(check_pidfile ${pidfile_authd} ${pidfile_authd} ${command_authd}) + if [ -z ${pid} ]; then + echo "pure-authd not running? (check ${pidfile_authd})." + return 1 + fi + echo "Stopping ${command_authd}." + kill -${sig_stop:-TERM} ${pid} + [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1 + wait_for_pids ${pid} + fi + if test -n ${pureftpd_upload_enable:-""} && checkyesno pureftpd_upload_enable; then + pid=$(check_pidfile ${pidfile_uploadscript} ${command_upload}) + if [ -z ${pid} ]; then + echo "Upload script not running? (check ${pidfile_uploadscript})." + 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" Modified: head/ftp/pure-ftpd/pkg-plist ============================================================================== --- head/ftp/pure-ftpd/pkg-plist Mon Mar 31 14:08:09 2014 (r349752) +++ head/ftp/pure-ftpd/pkg-plist Mon Mar 31 14:12:42 2014 (r349753) @@ -14,6 +14,7 @@ man/man8/pure-pwconvert.8.gz man/man8/pure-quotacheck.8.gz man/man8/pure-statsdecode.8.gz man/man8/pure-uploadscript.8.gz +sbin/pure-alwaysfail sbin/pure-authd sbin/pure-config.pl sbin/pure-ftpd _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!