From 5e28c835fc9008e5f1af81f6826791402ff1df42 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Sat, 3 Feb 2001 19:07:43 +0000 Subject: Add vsftpd 0.0.10, a FTP daemon that aims to be "very secure". --- ftp/Makefile | 1 + ftp/vsftpd/Makefile | 38 +++++++++++++++++++++++ ftp/vsftpd/distinfo | 1 + ftp/vsftpd/files/patch-aa | 57 +++++++++++++++++++++++++++++++++++ ftp/vsftpd/pkg-comment | 1 + ftp/vsftpd/pkg-descr | 11 +++++++ ftp/vsftpd/pkg-install | 77 +++++++++++++++++++++++++++++++++++++++++++++++ ftp/vsftpd/pkg-plist | 4 +++ 8 files changed, 190 insertions(+) create mode 100644 ftp/vsftpd/Makefile create mode 100644 ftp/vsftpd/distinfo create mode 100644 ftp/vsftpd/files/patch-aa create mode 100644 ftp/vsftpd/pkg-comment create mode 100644 ftp/vsftpd/pkg-descr create mode 100644 ftp/vsftpd/pkg-install create mode 100644 ftp/vsftpd/pkg-plist (limited to 'ftp') diff --git a/ftp/Makefile b/ftp/Makefile index 72395d9d293f..5c754612674f 100644 --- a/ftp/Makefile +++ b/ftp/Makefile @@ -33,6 +33,7 @@ SUBDIR += proftpd SUBDIR += sftp SUBDIR += spegla + SUBDIR += vsftpd SUBDIR += wget SUBDIR += wu-ftpd SUBDIR += xrmftp diff --git a/ftp/vsftpd/Makefile b/ftp/vsftpd/Makefile new file mode 100644 index 000000000000..7d61b42ff44a --- /dev/null +++ b/ftp/vsftpd/Makefile @@ -0,0 +1,38 @@ +# New ports collection makefile for: vsftpd +# Date created: 03 Feb 2001 +# Whom: Neil Blakey-Milner +# +# $FreeBSD$ +# + +PORTNAME= vsftpd +PORTVERSION= 0.0.10 +CATEGORIES= ftp +MASTER_SITES= ftp://ferret.lmh.ox.ac.uk/pub/linux/ + +MAINTAINER= nbm@FreeBSD.org + +ALL_TARGET= vsftpd + +post-patch: + @${PERL} -i -p -e \ + 's@^(#define VSFTP_DEFAULT_CONFIG )"[/]etc/vsftpd.conf"@\1"${PREFIX}/etc/vsftpd.conf"@' \ + ${WRKSRC}/defs.h + @${PERL} -i -p \ + -e 's@ -ldl@@;' \ + -e 's@^CFLAGS.*$$@@' \ + ${WRKSRC}/Makefile + @${ECHO} "secure_chroot_dir=${PREFIX}/share/vsftpd/empty" >> ${WRKSRC}/vsftpd.conf + +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 + @# + @${PERL5} ${PKGINSTALL} + +.include diff --git a/ftp/vsftpd/distinfo b/ftp/vsftpd/distinfo new file mode 100644 index 000000000000..f340ef8a0f7d --- /dev/null +++ b/ftp/vsftpd/distinfo @@ -0,0 +1 @@ +MD5 (vsftpd-0.0.10.tar.gz) = f43b0fa54e47907502c5800ed877e387 diff --git a/ftp/vsftpd/files/patch-aa b/ftp/vsftpd/files/patch-aa new file mode 100644 index 000000000000..b2fa89c79833 --- /dev/null +++ b/ftp/vsftpd/files/patch-aa @@ -0,0 +1,57 @@ +diff -ur sysutil.c work2/vsftpd-0.0.10/sysutil.c +--- sysutil.c Wed Jan 31 03:39:15 2001 ++++ sysutil.c Sat Feb 3 18:08:05 2001 +@@ -19,7 +19,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -30,7 +30,12 @@ + #include + #include + #include ++#ifndef BSD + #include ++#endif ++#ifdef BSD ++#include ++#endif + #include + #include + #include +@@ -38,6 +43,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -378,7 +384,11 @@ + vsf_sysutil_set_nodelay(int fd) + { + int nodelay = 1; ++#ifndef BSD + int retval = setsockopt(fd, SOL_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); ++#else ++ int retval = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); ++#endif + if (retval != 0) + { + die("setsockopt"); +@@ -413,7 +423,11 @@ + int tos = IPTOS_THROUGHPUT; + + /* Ignore failure to set (maybe this IP stack demands privilege for this) */ ++#ifndef BSD + (void) setsockopt(fd, SOL_IP, IP_TOS, &tos, sizeof(tos)); ++#else ++ (void) setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)); ++#endif + } + + int diff --git a/ftp/vsftpd/pkg-comment b/ftp/vsftpd/pkg-comment new file mode 100644 index 000000000000..f18f7f7e8671 --- /dev/null +++ b/ftp/vsftpd/pkg-comment @@ -0,0 +1 @@ +A FTP daemon that aims to be "very secure" diff --git a/ftp/vsftpd/pkg-descr b/ftp/vsftpd/pkg-descr new file mode 100644 index 000000000000..b1ebd8a9c204 --- /dev/null +++ b/ftp/vsftpd/pkg-descr @@ -0,0 +1,11 @@ +A FTP daemon that aims to be "very secure" + +From the README file: + + Author: Chris Evans + Contact: chris@scary.beasts.org + + vsftpd is an FTP server, or daemon. The "vs" stands for Very + Secure. Obviously this is not a guarantee, but a reflection + that I have written the entire codebase with security in mind, + and carefully designed the program to be resilient to attack. diff --git a/ftp/vsftpd/pkg-install b/ftp/vsftpd/pkg-install new file mode 100644 index 000000000000..766cc493d693 --- /dev/null +++ b/ftp/vsftpd/pkg-install @@ -0,0 +1,77 @@ +#!/usr/bin/perl +# + +@groups = ("operator"); +%users = ('ftp', "operator"); +# daemon, local, pop, queue, remote, deliver, respectively. +# alias is a special case above... +%gids = ('operator', 5); +%uids = ('ftp', 14); + +if ($ENV{PACKAGE_BUILDING} || $ARGV[1] eq "PRE-INSTALL") { + $doguid=1; # Make sure we get the assigned guids. +} + +foreach $group (@groups) { + if (! getgrnam ($group)) { + do checkrpw; # May exit + + $x = "-g $gids{$group}"; + $result = system ("/usr/sbin/pw groupadd $group $x"); + if ($result) { + die "Failed to add group $group as gid $gids{$group}\n"; + } + } +} + +foreach $user (keys %users) { + if (! getpwnam ($user)) { + do checkrpw; # May exit + + $x = "-u $uids{$user}"; + $result = system ("/usr/sbin/pw useradd $user -g $users{$user} -d \"/var/ftp\" -s /nonexistent $x"); + if ($result) { + die "Failed to add user $user as uid $uids{$user}\n"; + } + } +} + +# Check that all gids/uids are as they should be... +# If we are being installed as a package... +if ($doguid) { + foreach $group (@groups) { + if (getgrnam($group) != $gids{$group}) { + die "Group $group should have gid $gids{$group}\n"; + } + } + + foreach $user (keys %users) { + if (getpwnam($user) != $uids{$user}) { + die "User $user should have uid $uids{$user}\n"; + } + } +} + +exit 0; + +sub checkrpw { + if (! -x "/usr/sbin/pw") { + print <<'EOM'; +This system looks like a pre-2.2 version of FreeBSD. We see that it +is missing the "pw" utility. We need this utility. Please get and +install it, and try again. You can get the source from: + + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz + +EOM + die "No /usr/sbin/pw"; + } + + if ($> != 0) { + print "It is necessary to add missing vpopmail users/groups at"; + print "this stage. Please either add them manually or retry"; + print "as root."; + # Let pw(1) signal the failure so the user can see which + # group/user is actually missing. + } +} diff --git a/ftp/vsftpd/pkg-plist b/ftp/vsftpd/pkg-plist new file mode 100644 index 000000000000..cabe8461cc69 --- /dev/null +++ b/ftp/vsftpd/pkg-plist @@ -0,0 +1,4 @@ +libexec/vsftpd +@unexec if ! `grep -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 -- cgit v1.2.3