ports/130509: [PATCH] ftp/vsftpd: Assorted fixes

Matthias Andree matthias.andree at gmx.de
Tue Jan 13 15:10:02 UTC 2009


>Number:         130509
>Category:       ports
>Synopsis:       [PATCH] ftp/vsftpd: Assorted fixes
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 13 15:10:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 7.1-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD merlin.emma.line.org 7.1-RELEASE-p1 FreeBSD 7.1-RELEASE-p1 #1: Fri Jan  9 12:40:17 CET
>Description:
- Fix for: vsftpd doesn't run its pkg-install script from the Makefile, for
  lack of the positional arguments.
- Fix for: pkg-deinstall doesn't match the user used by pkg-install.
- Fix for: comment at top of vsftpd.conf doesn't match $PREFIX
- Add commented-out versions of listen=YES and background=YES to match the
  rcNG script's expectations.
- Add missing documentation on how to configure vsftpd to rcNG script.
- Fix two typos in rcNG script.

There are various other nits to pick, for instance, total lack of information
how to SECURELY set up a server (compare to lukemftpd man page), not
addressed by this patch.

Port maintainer (dinoex at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- vsftpd-2.0.7.patch begins here ---
? work
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/ftp/vsftpd/Makefile,v
retrieving revision 1.33
diff -u -u -r1.33 Makefile
--- Makefile	30 Jul 2008 14:09:34 -0000	1.33
+++ Makefile	13 Jan 2009 15:00:57 -0000
@@ -46,7 +46,7 @@
 
 do-configure:
 	${REINPLACE_CMD} -e "s|/etc/vsftpd.conf|${PREFIX}/etc/vsftpd.conf|" \
-		${WRKSRC}/defs.h
+		${WRKSRC}/defs.h ${WRKSRC}/vsftpd.conf
 	${REINPLACE_CMD} \
 		-e "s|^CC 	=	gcc|CC	= ${CC}|" \
 		-e "s|^CFLAGS	=|CFLAGS	= ${CFLAGS}|" \
@@ -57,6 +57,11 @@
 		${WRKSRC}/builddefs.h
 	${ECHO_CMD} "secure_chroot_dir=${PREFIX}/share/vsftpd/empty" >> \
 		${WRKSRC}/vsftpd.conf
+	${ECHO_CMD} >>${WRKSRC}/vsftpd.conf ""
+	${ECHO_CMD} >>${WRKSRC}/vsftpd.conf \
+		"# If using vsftpd in standalone mode, uncomment the next two lines:"
+	${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# listen=YES"
+	${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# background=YES"
 	${REINPLACE_CMD} -e "s|/etc/v|${PREFIX}/etc/v|" \
 		-e 's|delay_failed_logins|delay_failed_login|' \
 		-e 's|delay_successful_logins|delay_successful_login|' \
@@ -67,6 +72,9 @@
 		${WRKSRC}/builddefs.h
 .endif
 
+pre-install:
+	${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/vsftpd ${PREFIX}/libexec/
 	${INSTALL_DATA} ${WRKSRC}/vsftpd.conf ${PREFIX}/etc/vsftpd.conf.dist
@@ -81,7 +89,6 @@
 	@for i in ${MAN5} ; do \
 		${INSTALL_MAN} -m 644 ${WRKSRC}/$${i} ${MANPREFIX}/man/man5/ ; \
 		done
-	${SH} ${PKGINSTALL}
 	${MKDIR} /var/ftp
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
Index: pkg-deinstall
===================================================================
RCS file: /home/ncvs/ports/ftp/vsftpd/pkg-deinstall,v
retrieving revision 1.1
diff -u -u -r1.1 pkg-deinstall
--- pkg-deinstall	23 Mar 2002 11:12:19 -0000	1.1
+++ pkg-deinstall	13 Jan 2009 15:00:57 -0000
@@ -6,7 +6,7 @@
     exit 0
 fi
 
-USER=vsftpd
+USER=ftp
 
 if pw usershow "${USER}" 2>/dev/null 1>&2; then
         echo "To delete FTP user permanently, use 'pw userdel ${USER}'"
Index: files/vsftpd.sh.in
===================================================================
RCS file: /home/ncvs/ports/ftp/vsftpd/files/vsftpd.sh.in,v
retrieving revision 1.7
diff -u -u -r1.7 vsftpd.sh.in
--- files/vsftpd.sh.in	20 Feb 2006 20:47:01 -0000	1.7
+++ files/vsftpd.sh.in	13 Jan 2009 15:00:57 -0000
@@ -6,11 +6,19 @@
 # PROVIDE: vsftpd
 # REQUIRE: DAEMON
 
-# Add the following line to /etc/rc.conf to enable `vsftpd':
+# To enable 'vsftpd' in standalone mode, you need to edit two files.
+# 1. add the following line(s) to /etc/rc.conf to enable `vsftpd':
 #
 # vsftpd_enable="YES"
 # vsftpd_flags="/some/path/conf.file" # Not required
 #
+# 2. tell vsftpd about standalone mode
+# Edit %%PREFIX%%/etc/vsftpd.conf (or /some/path/conf.file) to contain
+#
+# listen=YES
+# background=YES
+#
+# Samples are provided at the end of the configuration file.
 
 . "%%RC_SUBR%%"
 
@@ -33,11 +41,11 @@
 	fi
 	if ! egrep -q -i -E "^listen.*=.*YES$" ${required_files}
 	then
-		err 1 "vsftpd script need "listen=YES" on config file"
+		err 1 "vsftpd script need "listen=YES" in config file"
 	fi
 	if ! egrep -q -i -E "^background.*=.*YES$" ${required_files}
 	then
-		err 1 "vsftpd script need "background=YES" on config file"
+		err 1 "vsftpd script need "background=YES" in config file"
 	fi
 }
 
--- vsftpd-2.0.7.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list