Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2009 19:45:33 GMT
From:      Maxim Ignatenko <gelraen.ua@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/132556: New port: ftp/vsftpd-ext Extended build of ftp/vsftpd
Message-ID:  <200903111945.n2BJjXl0069888@www.freebsd.org>
Resent-Message-ID: <200903111950.n2BJo3PZ042508@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         132556
>Category:       ports
>Synopsis:       New port: ftp/vsftpd-ext   Extended build of ftp/vsftpd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 11 19:50:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Maxim Ignatenko
>Release:        8.0-CURRENT
>Organization:
Kiev National Taras Shevchenko University
>Environment:
FreeBSD imax 8.0-CURRENT FreeBSD 8.0-CURRENT #38: Mon Feb 23 23:48:33 EET 2009     root@imax:/usr/obj/usr/src/sys/HEAD  i386
>Description:
Extended build of vsftpd with additional features:
 - Added char convertion without iconv for some charsets. 
 - Added rules for anonymous access based on user's IP address masks. 
 - Added rules for user access only from defined IPs. 
 - Allow or disallow delete files by anonymous. 
 - Added chowning anonymous uploaded files by user IP. 
 - Added new parametr double_377 (by default 1). This paramert switch off telnet specific character \377. 
 - Changed find libs in "vsf_findlibs.sh". 
 - Different speed for upload and download data transfer rates for anonymous and local users.

Author's website: http://vsftpd.devnet.ru/eng/
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	ftp/vsftpd-ext
#	ftp/vsftpd-ext/files
#	ftp/vsftpd-ext/files/patch-utility
#	ftp/vsftpd-ext/files/vsftpd.sh.in
#	ftp/vsftpd-ext/distinfo
#	ftp/vsftpd-ext/pkg-deinstall
#	ftp/vsftpd-ext/pkg-descr
#	ftp/vsftpd-ext/pkg-install
#	ftp/vsftpd-ext/pkg-plist
#	ftp/vsftpd-ext/Makefile
#
echo c - ftp/vsftpd-ext
mkdir -p ftp/vsftpd-ext > /dev/null 2>&1
echo c - ftp/vsftpd-ext/files
mkdir -p ftp/vsftpd-ext/files > /dev/null 2>&1
echo x - ftp/vsftpd-ext/files/patch-utility
sed 's/^X//' >ftp/vsftpd-ext/files/patch-utility << '5fb06e20cc564b3d34b00d19e41524b7'
X--- utility.c.orig      Fri Jul  2 18:26:30 2004
X+++ utility.c   Mon Oct 10 01:19:02 2005
X@@ -33,6 +33,10 @@
X void
X bug(const char* p_text)
X {
X+  static int inside_bug = 0;
X+  if (inside_bug)
X+    vsf_sysutil_exit(1);
X+  inside_bug++;
X   /* Rats. Try and write the reason to the network for diagnostics */
X   vsf_sysutil_activate_noblock(VSFTP_COMMAND_FD);
X   (void) vsf_sysutil_write_loop(VSFTP_COMMAND_FD, "500 OOPS: ", 10);
5fb06e20cc564b3d34b00d19e41524b7
echo x - ftp/vsftpd-ext/files/vsftpd.sh.in
sed 's/^X//' >ftp/vsftpd-ext/files/vsftpd.sh.in << 'a138aa26ab7d28ee09b90d11c303b4d5'
X#!/bin/sh
X#
X# $FreeBSD: ports/ftp/vsftpd/files/vsftpd.sh.in,v 1.8 2009/01/17 06:04:20 dinoex Exp $
X#
X
X# PROVIDE: vsftpd
X# REQUIRE: DAEMON
X
X# To enable 'vsftpd' in standalone mode, you need to edit two files.
X# 1. add the following line(s) to /etc/rc.conf to enable `vsftpd':
X#
X# vsftpd_enable="YES"
X# vsftpd_flags="/some/path/conf.file" # Not required
X#
X# 2. tell vsftpd about standalone mode
X# Edit %%PREFIX%%/etc/vsftpd.conf (or /some/path/conf.file) to contain
X#
X# listen=YES
X# background=YES
X#
X# Samples are provided at the end of the configuration file.
X
X. "%%RC_SUBR%%"
X
Xname="vsftpd"
Xrcvar=`set_rcvar`
X
Xload_rc_config "$name"
X: ${vsftpd_enable:="NO"}
X: ${vsftpd_flags:=""}
X
Xcommand="%%PREFIX%%/libexec/$name"
Xrequired_files="%%PREFIX%%/etc/$name.conf"
Xstart_precmd="vsftpd_check"
X
Xvsftpd_check()
X{
X	if grep -q "^ftp[ 	]" /etc/inetd.conf ${required_files}
X	then
X		err 1 "ftp is already activated in /etc/inetd.conf"
X	fi
X	if ! egrep -q -i -E "^listen.*=.*YES$" ${required_files}
X	then
X		err 1 'vsftpd script need "listen=YES" in config file'
X	fi
X	if ! egrep -q -i -E "^background.*=.*YES$" ${required_files}
X	then
X		err 1 'vsftpd script need "background=YES" in config file'
X	fi
X}
X
Xrun_rc_command "$1"
a138aa26ab7d28ee09b90d11c303b4d5
echo x - ftp/vsftpd-ext/distinfo
sed 's/^X//' >ftp/vsftpd-ext/distinfo << 'c6250ee6affa7e0ad13eac2604179179'
XMD5 (vsftpd-2.1.0.tar.gz) = 7890b54e7ffa6106ffbdfda53f47fa41
XSHA256 (vsftpd-2.1.0.tar.gz) = 82fdb75d44f1bbf1ee7930265a772dd13ebd314d389692c6788e9e2b4b116c87
XSIZE (vsftpd-2.1.0.tar.gz) = 178636
XMD5 (vsftpd-2.1.0-ext1.diff.gz) = 22db8eb3857620f8415eac4c6478b5a4
XSHA256 (vsftpd-2.1.0-ext1.diff.gz) = 88e29b0af40d8be44e1e425b78784ad9102f7dc301994ed71844fc49d0f57d85
XSIZE (vsftpd-2.1.0-ext1.diff.gz) = 32509
c6250ee6affa7e0ad13eac2604179179
echo x - ftp/vsftpd-ext/pkg-deinstall
sed 's/^X//' >ftp/vsftpd-ext/pkg-deinstall << 'ccdd2c266f648c77723fe9c9c9c8daea'
X#!/bin/sh
X# $FreeBSD: ports/ftp/vsftpd/pkg-deinstall,v 1.2 2009/01/17 06:04:20 dinoex Exp $
X#
X
Xif [ "$2" != "POST-DEINSTALL" ]; then
X    exit 0
Xfi
X
XUSER=ftp
X
Xif pw usershow "${USER}" 2>/dev/null 1>&2; then
X        echo "To delete FTP user permanently, use 'pw userdel ${USER}'"
X        echo "Don't do this if you're using FreeBSD's anonymous FTP server"
Xfi
X
Xexit 0
ccdd2c266f648c77723fe9c9c9c8daea
echo x - ftp/vsftpd-ext/pkg-descr
sed 's/^X//' >ftp/vsftpd-ext/pkg-descr << 'f617b089c127eb4534292ebb0a0d6e02'
XExtended build of vsftpd with additional features.
X
XWWW: http://vsftpd.devnet.ru/eng/
f617b089c127eb4534292ebb0a0d6e02
echo x - ftp/vsftpd-ext/pkg-install
sed 's/^X//' >ftp/vsftpd-ext/pkg-install << '7345eb0f725db66e1a0f71c639653250'
X#!/bin/sh
X# $FreeBSD: ports/ftp/vsftpd/pkg-install,v 1.5 2008/05/24 10:09:18 dinoex Exp $
X#
X
Xif [ "$2" != "PRE-INSTALL" ]; then
X    exit 0
Xfi
X
Xif ! pw groupshow operator >/dev/null; then
X	if pw groupadd operator 5; then
X		echo "Added group operator for vsftpd"
X	else
X		echo "Failed to add group operator as gid 5" >&2
X		exit 1
X	fi
Xfi
X
Xif ! pw usershow ftp >/dev/null; then
X	if pw useradd ftp -g operator -u 14 -h - -d /var/ftp -s /nonexistent -c "Anonymous Ftp"; then
X		echo "Added user ftp for vsftpd"
X	else
X		echo "Failed to add user ftp as gid 14" >&2
X		exit 1
X	fi
Xfi
X
X# uid=14(ftp) gid=5(operator) groups=5(operator)
Xview="$(id ftp)"
Xview="${view%% *}"
Xif test "${view}" = "uid=14(ftp)"; then
X	exit 0
Xfi
X
Xecho "User ftp should have uid 14"; >&2
Xexit 1
X# eof
7345eb0f725db66e1a0f71c639653250
echo x - ftp/vsftpd-ext/pkg-plist
sed 's/^X//' >ftp/vsftpd-ext/pkg-plist << '7062996c2fddfde70553c37306594888'
Xlibexec/vsftpd
X@exec mkdir -p %D/share/vsftpd/empty
X@unexec if diff -q %D/etc/vsftpd.conf %D/etc/vsftpd.conf.dist; then rm %D/etc/vsftpd.conf; fi
Xetc/vsftpd.conf.dist
X@exec if [ ! -f %B/vsftpd.conf ]; then cp %B/vsftpd.conf.dist %B/vsftpd.conf; fi
X@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
X@unexec rmdir /var/ftp 2>/dev/null || true
X@dirrm share/vsftpd/empty
X@dirrm share/vsftpd
X%%PORTDOCS%%%%DOCSDIR%%/AUDIT
X%%PORTDOCS%%%%DOCSDIR%%/BENCHMARKS
X%%PORTDOCS%%%%DOCSDIR%%/BUGS
X%%PORTDOCS%%%%DOCSDIR%%/Changelog
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE/README
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE/vsftpd.conf
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE/vsftpd.xinetd
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE_NOINETD/README
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE_NOINETD/vsftpd.conf
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/PER_IP_CONFIG/README
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/PER_IP_CONFIG/hosts.allow
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/README
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_HOSTS/README
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/README
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/logins.txt
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/vsftpd.conf
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/vsftpd.pam
X%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS_2/README
X%%PORTDOCS%%%%DOCSDIR%%/FAQ
X%%PORTDOCS%%%%DOCSDIR%%/INSTALL
X%%PORTDOCS%%%%DOCSDIR%%/LICENSE
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%%%DOCSDIR%%/README.security
X%%PORTDOCS%%%%DOCSDIR%%/README.ssl
X%%PORTDOCS%%%%DOCSDIR%%/REFS
X%%PORTDOCS%%%%DOCSDIR%%/REWARD
X%%PORTDOCS%%%%DOCSDIR%%/SECURITY/DESIGN
X%%PORTDOCS%%%%DOCSDIR%%/SECURITY/IMPLEMENTATION
X%%PORTDOCS%%%%DOCSDIR%%/SECURITY/OVERVIEW
X%%PORTDOCS%%%%DOCSDIR%%/SECURITY/TRUST
X%%PORTDOCS%%%%DOCSDIR%%/SIZE
X%%PORTDOCS%%%%DOCSDIR%%/SPEED
X%%PORTDOCS%%%%DOCSDIR%%/TODO
X%%PORTDOCS%%%%DOCSDIR%%/TUNING
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/INTERNET_SITE
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/INTERNET_SITE_NOINETD
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/PER_IP_CONFIG
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/VIRTUAL_HOSTS
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS_2
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE
X%%PORTDOCS%%@dirrm %%DOCSDIR%%/SECURITY
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
7062996c2fddfde70553c37306594888
echo x - ftp/vsftpd-ext/Makefile
sed 's/^X//' >ftp/vsftpd-ext/Makefile << '2124b62691a6bf0b8cf416afb802edcd'
X# New ports collection makefile for: vsftpd-ext
X# Date created:		11 Mar 2009
X# Whom:			Maxim Ignatenko
X#
X# $FreeBSD$
X#
X
XPORTNAME=	vsftpd-ext
XPORTVERSION=	2.1.0
XCATEGORIES=	ftp ipv6
XMASTER_SITES=	ftp://vsftpd.beasts.org/users/cevans/
XPKGNAMESUFFIX?=	1${SSL_SUFFIX}${PKGNAMESUFFIX2}
X
XMAINTAINER=	gelraen.ua@gmail.com
XCOMMENT=	A FTP daemon that aims to be "very secure". Extended build
X
XDISTNAME=	vsftpd-${PORTVERSION}
X
XCONFLICTS=	vsftpd-2* vsftpd${SSL_SUFFIX}${PKGNAMESUFFIX2}-2*
X
XPATCH_SITES=	http://vsftpd.devnet.ru/files/${PORTVERSION}/ext.1/diff/
XPATCHFILES=	vsftpd-${PORTVERSION}-ext1.diff.gz
XPATCH_DIST_STRIP=-p2
X
XALL_TARGET=	vsftpd
XMAN5=		vsftpd.conf.5
XMAN8=		vsftpd.8
XDOCFILES=	AUDIT BENCHMARKS BUGS Changelog FAQ INSTALL LICENSE \
X		README README.security README.ssl REFS REWARD \
X		SIZE SPEED TODO TUNING
X
XLDFLAGS+=	-lwrap
X
XOPTIONS=	RC_NG		"install RC_NG script"		off \
X		VSFTPD_SSL	"Include support for SSL"	off
X
X.include <bsd.port.pre.mk>
X
X.if defined(WITH_RC_NG)
XUSE_RC_SUBR=	vsftpd.sh
X.endif
X
X.if defined(WITH_VSFTPD_SSL) && !defined(WITHOUT_SSL)
X.if ${OSVERSION} < 700000
XWITH_OPENSSL_PORT=	yes
X.endif
X.include "${PORTSDIR}/Mk/bsd.openssl.mk"
XSSL_SUFFIX=	-ssl
XCFLAGS+=	-I${OPENSSLINC}
XLDFLAGS+=	-L${OPENSSLLIB}
X.else
XMAKE_ENV+=	LDFLAGS="${LDFLAGS}"
X.endif
X
Xdo-configure:
X	${REINPLACE_CMD} -e "s|/etc/vsftpd.conf|${PREFIX}/etc/vsftpd.conf|" \
X		${WRKSRC}/defs.h ${WRKSRC}/vsftpd.conf
X	${REINPLACE_CMD} \
X		-e "s|^CC 	=	gcc|CC	= ${CC}|" \
X		-e "s|^CFLAGS	=|CFLAGS	= ${CFLAGS}|" \
X		-e "s|	-Wl,-s| -Wl,-s ${LDFLAGS}|" \
X		${WRKSRC}/Makefile
X	${REINPLACE_CMD} -e \
X		"s|#undef VSF_BUILD_TCPWRAPPERS|#define VSF_BUILD_TCPWRAPPERS 1|" \
X		${WRKSRC}/builddefs.h
X	@${ECHO_CMD} "secure_chroot_dir=${PREFIX}/share/vsftpd/empty" >> \
X		${WRKSRC}/vsftpd.conf
X	@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf ""
X	@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf \
X		"# If using vsftpd in standalone mode, uncomment the next two lines:"
X	@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# listen=YES"
X	@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# background=YES"
X	${REINPLACE_CMD} -e "s|/etc/v|${PREFIX}/etc/v|" \
X		-e 's|delay_failed_logins|delay_failed_login|' \
X		-e 's|delay_successful_logins|delay_successful_login|' \
X		${WRKSRC}/vsftpd.8 ${WRKSRC}/vsftpd.conf.5 ${WRKSRC}/tunables.c
X.if !defined(WITHOUT_SSL) && defined(WITH_VSFTPD_SSL)
X	${REINPLACE_CMD} -e \
X		"s|#undef VSF_BUILD_SSL|#define VSF_BUILD_SSL 1|" \
X		${WRKSRC}/builddefs.h
X.endif
X
Xpre-install:
X	${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/vsftpd ${PREFIX}/libexec/
X	${INSTALL_DATA} ${WRKSRC}/vsftpd.conf ${PREFIX}/etc/vsftpd.conf.dist
X	${INSTALL} -d ${PREFIX}/share/vsftpd/empty
X	@if [ ! -e ${PREFIX}/etc/vsftpd.conf ]; then \
X		${INSTALL_DATA} ${WRKSRC}/vsftpd.conf ${PREFIX}/etc/ ; \
X	fi
X	${MKDIR} ${PREFIX}/share/vsftpd/empty
X	@for i in ${MAN8} ; do \
X		${INSTALL_MAN} -m 644 ${WRKSRC}/$${i} ${MANPREFIX}/man/man8/ ; \
X		done
X	@for i in ${MAN5} ; do \
X		${INSTALL_MAN} -m 644 ${WRKSRC}/$${i} ${MANPREFIX}/man/man5/ ; \
X		done
X	${MKDIR} /var/ftp
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X.for i in ${DOCFILES}
X	${INSTALL_DATA} -m 644 ${WRKSRC}/${i} ${DOCSDIR}
X.endfor
X.for i in EXAMPLE SECURITY
X	${MKDIR} ${DOCSDIR}/${i}
X	${CP} -p -R -L ${WRKSRC}/${i}/./ ${DOCSDIR}/${i}/
X	${CHMOD} -R -L a+rX,go-w ${DOCSDIR}/${i}/
X.endfor
X.endif
X
X.include <bsd.port.post.mk>
2124b62691a6bf0b8cf416afb802edcd
exit



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903111945.n2BJjXl0069888>