diff options
author | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2009-06-16 03:53:40 +0000 |
---|---|---|
committer | Philip M. Gollucci <pgollucci@FreeBSD.org> | 2009-06-16 03:53:40 +0000 |
commit | 2b9da571f3bef1a8d1248e488bd315146260ce41 (patch) | |
tree | 31b81a3f61ee614e9ca2f2e1dc3b98310faaa3e0 /ftp | |
parent | de7d90973727c4cd8fd2eea61f9b9e4fd09b010d (diff) | |
download | ports-2b9da571f3bef1a8d1248e488bd315146260ce41.tar.gz ports-2b9da571f3bef1a8d1248e488bd315146260ce41.zip |
Notes
Diffstat (limited to 'ftp')
-rw-r--r-- | ftp/Makefile | 1 | ||||
-rw-r--r-- | ftp/vsftpd-ext/Makefile | 112 | ||||
-rw-r--r-- | ftp/vsftpd-ext/distinfo | 6 | ||||
-rw-r--r-- | ftp/vsftpd-ext/files/patch-utility | 13 | ||||
-rw-r--r-- | ftp/vsftpd-ext/files/vsftpd.sh.in | 52 | ||||
-rw-r--r-- | ftp/vsftpd-ext/pkg-deinstall | 16 | ||||
-rw-r--r-- | ftp/vsftpd-ext/pkg-descr | 3 | ||||
-rw-r--r-- | ftp/vsftpd-ext/pkg-install | 36 | ||||
-rw-r--r-- | ftp/vsftpd-ext/pkg-plist | 52 |
9 files changed, 291 insertions, 0 deletions
diff --git a/ftp/Makefile b/ftp/Makefile index af7cf4a60b34..0204b122d8cd 100644 --- a/ftp/Makefile +++ b/ftp/Makefile @@ -107,6 +107,7 @@ SUBDIR += uftp SUBDIR += urlgfe SUBDIR += vsftpd + SUBDIR += vsftpd-ext SUBDIR += waiho SUBDIR += weex SUBDIR += wget diff --git a/ftp/vsftpd-ext/Makefile b/ftp/vsftpd-ext/Makefile new file mode 100644 index 000000000000..d2b800bb2362 --- /dev/null +++ b/ftp/vsftpd-ext/Makefile @@ -0,0 +1,112 @@ +# New ports collection makefile for: vsftpd-ext +# Date created: 11 Mar 2009 +# Whom: Maxim Ignatenko +# +# $FreeBSD$ +# + +PORTNAME= vsftpd-ext +PORTVERSION= 2.1.0 +CATEGORIES= ftp ipv6 +MASTER_SITES= ftp://vsftpd.beasts.org/users/cevans/ +PKGNAMESUFFIX?= 1${SSL_SUFFIX}${PKGNAMESUFFIX2} +DISTNAME= vsftpd-${PORTVERSION} + +PATCH_SITES= http://vsftpd.devnet.ru/files/${PORTVERSION}/ext.1/diff/ +PATCHFILES= vsftpd-${PORTVERSION}-ext1.diff.gz +PATCH_DIST_STRIP=-p2 + +MAINTAINER= gelraen.ua@gmail.com +COMMENT= A FTP daemon that aims to be "very secure". Extended build + +CONFLICTS= vsftpd-2* vsftpd${SSL_SUFFIX}${PKGNAMESUFFIX2}-2* + +ALL_TARGET= vsftpd +MAN5= vsftpd.conf.5 +MAN8= vsftpd.8 +DOCFILES= AUDIT BENCHMARKS BUGS Changelog FAQ INSTALL LICENSE \ + README README.security README.ssl REFS REWARD \ + SIZE SPEED TODO TUNING + +LDFLAGS+= -lwrap + +OPTIONS= RC_NG "install RC_NG script" off \ + VSFTPD_SSL "Include support for SSL" off + +.include <bsd.port.pre.mk> + +.if defined(WITH_RC_NG) +USE_RC_SUBR= vsftpd.sh +.endif + +.if defined(WITH_VSFTPD_SSL) && !defined(WITHOUT_SSL) +.if ${OSVERSION} < 700000 +WITH_OPENSSL_PORT= yes +.endif +.include "${PORTSDIR}/Mk/bsd.openssl.mk" +SSL_SUFFIX= -ssl +CFLAGS+= -I${OPENSSLINC} +LDFLAGS+= -L${OPENSSLLIB} +.else +MAKE_ENV+= LDFLAGS="${LDFLAGS}" +.endif + +do-configure: + ${REINPLACE_CMD} -e "s|/etc/vsftpd.conf|${PREFIX}/etc/vsftpd.conf|" \ + ${WRKSRC}/defs.h ${WRKSRC}/vsftpd.conf + ${REINPLACE_CMD} \ + -e "s|^CC = gcc|CC = ${CC}|" \ + -e "s|^CFLAGS =|CFLAGS = ${CFLAGS}|" \ + -e "s| -Wl,-s| -Wl,-s ${LDFLAGS}|" \ + ${WRKSRC}/Makefile + ${REINPLACE_CMD} -e \ + "s|#undef VSF_BUILD_TCPWRAPPERS|#define VSF_BUILD_TCPWRAPPERS 1|" \ + ${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|' \ + ${WRKSRC}/vsftpd.8 ${WRKSRC}/vsftpd.conf.5 ${WRKSRC}/tunables.c +.if !defined(WITHOUT_SSL) && defined(WITH_VSFTPD_SSL) + ${REINPLACE_CMD} -e \ + "s|#undef VSF_BUILD_SSL|#define VSF_BUILD_SSL 1|" \ + ${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 + ${INSTALL} -d ${PREFIX}/share/vsftpd/empty + @if [ ! -e ${PREFIX}/etc/vsftpd.conf ]; then \ + ${INSTALL_DATA} ${WRKSRC}/vsftpd.conf ${PREFIX}/etc/ ; \ + fi + ${MKDIR} ${PREFIX}/share/vsftpd/empty + @for i in ${MAN8} ; do \ + ${INSTALL_MAN} -m 644 ${WRKSRC}/$${i} ${MANPREFIX}/man/man8/ ; \ + done + @for i in ${MAN5} ; do \ + ${INSTALL_MAN} -m 644 ${WRKSRC}/$${i} ${MANPREFIX}/man/man5/ ; \ + done + ${MKDIR} /var/ftp +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for i in ${DOCFILES} + ${INSTALL_DATA} -m 644 ${WRKSRC}/${i} ${DOCSDIR} +.endfor +.for i in EXAMPLE SECURITY + ${MKDIR} ${DOCSDIR}/${i} + ${CP} -p -R -L ${WRKSRC}/${i}/./ ${DOCSDIR}/${i}/ + ${CHMOD} -R -L a+rX,go-w ${DOCSDIR}/${i}/ +.endfor +.endif + +.include <bsd.port.post.mk> diff --git a/ftp/vsftpd-ext/distinfo b/ftp/vsftpd-ext/distinfo new file mode 100644 index 000000000000..94174968c5d2 --- /dev/null +++ b/ftp/vsftpd-ext/distinfo @@ -0,0 +1,6 @@ +MD5 (vsftpd-2.1.0.tar.gz) = 7890b54e7ffa6106ffbdfda53f47fa41 +SHA256 (vsftpd-2.1.0.tar.gz) = 82fdb75d44f1bbf1ee7930265a772dd13ebd314d389692c6788e9e2b4b116c87 +SIZE (vsftpd-2.1.0.tar.gz) = 178636 +MD5 (vsftpd-2.1.0-ext1.diff.gz) = 22db8eb3857620f8415eac4c6478b5a4 +SHA256 (vsftpd-2.1.0-ext1.diff.gz) = 88e29b0af40d8be44e1e425b78784ad9102f7dc301994ed71844fc49d0f57d85 +SIZE (vsftpd-2.1.0-ext1.diff.gz) = 32509 diff --git a/ftp/vsftpd-ext/files/patch-utility b/ftp/vsftpd-ext/files/patch-utility new file mode 100644 index 000000000000..95b107022844 --- /dev/null +++ b/ftp/vsftpd-ext/files/patch-utility @@ -0,0 +1,13 @@ +--- utility.c.orig Fri Jul 2 18:26:30 2004 ++++ utility.c Mon Oct 10 01:19:02 2005 +@@ -33,6 +33,10 @@ + void + bug(const char* p_text) + { ++ static int inside_bug = 0; ++ if (inside_bug) ++ vsf_sysutil_exit(1); ++ inside_bug++; + /* Rats. Try and write the reason to the network for diagnostics */ + vsf_sysutil_activate_noblock(VSFTP_COMMAND_FD); + (void) vsf_sysutil_write_loop(VSFTP_COMMAND_FD, "500 OOPS: ", 10); diff --git a/ftp/vsftpd-ext/files/vsftpd.sh.in b/ftp/vsftpd-ext/files/vsftpd.sh.in new file mode 100644 index 000000000000..3ce7bb15982f --- /dev/null +++ b/ftp/vsftpd-ext/files/vsftpd.sh.in @@ -0,0 +1,52 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: vsftpd +# REQUIRE: DAEMON + +# 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%%" + +name="vsftpd" +rcvar=`set_rcvar` + +load_rc_config "$name" +: ${vsftpd_enable:="NO"} +: ${vsftpd_flags:=""} + +command="%%PREFIX%%/libexec/$name" +required_files="%%PREFIX%%/etc/$name.conf" +start_precmd="vsftpd_check" + +vsftpd_check() +{ + if grep -q "^ftp[ ]" /etc/inetd.conf ${required_files} + then + err 1 "ftp is already activated in /etc/inetd.conf" + fi + if ! egrep -q -i -E "^listen.*=.*YES$" ${required_files} + then + 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" in config file' + fi +} + +run_rc_command "$1" diff --git a/ftp/vsftpd-ext/pkg-deinstall b/ftp/vsftpd-ext/pkg-deinstall new file mode 100644 index 000000000000..654d3223c297 --- /dev/null +++ b/ftp/vsftpd-ext/pkg-deinstall @@ -0,0 +1,16 @@ +#!/bin/sh +# $FreeBSD: /tmp/pcvs/ports/ftp/vsftpd-ext/pkg-deinstall,v 1.1 2009-06-16 03:53:39 pgollucci Exp $ +# + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +USER=ftp + +if pw usershow "${USER}" 2>/dev/null 1>&2; then + echo "To delete FTP user permanently, use 'pw userdel ${USER}'" + echo "Don't do this if you're using FreeBSD's anonymous FTP server" +fi + +exit 0 diff --git a/ftp/vsftpd-ext/pkg-descr b/ftp/vsftpd-ext/pkg-descr new file mode 100644 index 000000000000..8871f4927dc7 --- /dev/null +++ b/ftp/vsftpd-ext/pkg-descr @@ -0,0 +1,3 @@ +Extended build of vsftpd with additional features. + +WWW: http://vsftpd.devnet.ru/eng/ diff --git a/ftp/vsftpd-ext/pkg-install b/ftp/vsftpd-ext/pkg-install new file mode 100644 index 000000000000..649591984281 --- /dev/null +++ b/ftp/vsftpd-ext/pkg-install @@ -0,0 +1,36 @@ +#!/bin/sh +# $FreeBSD: /tmp/pcvs/ports/ftp/vsftpd-ext/pkg-install,v 1.1 2009-06-16 03:53:39 pgollucci Exp $ +# + +if [ "$2" != "PRE-INSTALL" ]; then + exit 0 +fi + +if ! pw groupshow operator >/dev/null; then + if pw groupadd operator 5; then + echo "Added group operator for vsftpd" + else + echo "Failed to add group operator as gid 5" >&2 + exit 1 + fi +fi + +if ! pw usershow ftp >/dev/null; then + if pw useradd ftp -g operator -u 14 -h - -d /var/ftp -s /nonexistent -c "Anonymous Ftp"; then + echo "Added user ftp for vsftpd" + else + echo "Failed to add user ftp as gid 14" >&2 + exit 1 + fi +fi + +# uid=14(ftp) gid=5(operator) groups=5(operator) +view="$(id ftp)" +view="${view%% *}" +if test "${view}" = "uid=14(ftp)"; then + exit 0 +fi + +echo "User ftp should have uid 14"; >&2 +exit 1 +# eof diff --git a/ftp/vsftpd-ext/pkg-plist b/ftp/vsftpd-ext/pkg-plist new file mode 100644 index 000000000000..9460fe25cea2 --- /dev/null +++ b/ftp/vsftpd-ext/pkg-plist @@ -0,0 +1,52 @@ +libexec/vsftpd +@exec mkdir -p %D/share/vsftpd/empty +@unexec if diff -q %D/etc/vsftpd.conf %D/etc/vsftpd.conf.dist; then rm %D/etc/vsftpd.conf; fi +etc/vsftpd.conf.dist +@exec if [ ! -f %B/vsftpd.conf ]; then cp %B/vsftpd.conf.dist %B/vsftpd.conf; fi +@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi +@unexec rmdir /var/ftp 2>/dev/null || true +@dirrm share/vsftpd/empty +@dirrm share/vsftpd +%%PORTDOCS%%%%DOCSDIR%%/AUDIT +%%PORTDOCS%%%%DOCSDIR%%/BENCHMARKS +%%PORTDOCS%%%%DOCSDIR%%/BUGS +%%PORTDOCS%%%%DOCSDIR%%/Changelog +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE/README +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE/vsftpd.conf +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE/vsftpd.xinetd +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE_NOINETD/README +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/INTERNET_SITE_NOINETD/vsftpd.conf +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/PER_IP_CONFIG/README +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/PER_IP_CONFIG/hosts.allow +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/README +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_HOSTS/README +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/README +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/logins.txt +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/vsftpd.conf +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS/vsftpd.pam +%%PORTDOCS%%%%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS_2/README +%%PORTDOCS%%%%DOCSDIR%%/FAQ +%%PORTDOCS%%%%DOCSDIR%%/INSTALL +%%PORTDOCS%%%%DOCSDIR%%/LICENSE +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/README.security +%%PORTDOCS%%%%DOCSDIR%%/README.ssl +%%PORTDOCS%%%%DOCSDIR%%/REFS +%%PORTDOCS%%%%DOCSDIR%%/REWARD +%%PORTDOCS%%%%DOCSDIR%%/SECURITY/DESIGN +%%PORTDOCS%%%%DOCSDIR%%/SECURITY/IMPLEMENTATION +%%PORTDOCS%%%%DOCSDIR%%/SECURITY/OVERVIEW +%%PORTDOCS%%%%DOCSDIR%%/SECURITY/TRUST +%%PORTDOCS%%%%DOCSDIR%%/SIZE +%%PORTDOCS%%%%DOCSDIR%%/SPEED +%%PORTDOCS%%%%DOCSDIR%%/TODO +%%PORTDOCS%%%%DOCSDIR%%/TUNING +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/INTERNET_SITE +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/INTERNET_SITE_NOINETD +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/PER_IP_CONFIG +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/VIRTUAL_HOSTS +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE/VIRTUAL_USERS_2 +%%PORTDOCS%%@dirrm %%DOCSDIR%%/EXAMPLE +%%PORTDOCS%%@dirrm %%DOCSDIR%%/SECURITY +%%PORTDOCS%%@dirrm %%DOCSDIR%% |