diff options
author | Wesley Shields <wxs@FreeBSD.org> | 2010-09-26 19:22:23 +0000 |
---|---|---|
committer | Wesley Shields <wxs@FreeBSD.org> | 2010-09-26 19:22:23 +0000 |
commit | bc59a3eafef40fb726faaa6bb39d660b88f63414 (patch) | |
tree | 7f14242f23e37d6f5b1c5ca02a1f99670b671641 /ftp/tnftpd | |
parent | 04143d208771f7662ac899644bdc506241f1e082 (diff) | |
download | ports-bc59a3eafef40fb726faaa6bb39d660b88f63414.tar.gz ports-bc59a3eafef40fb726faaa6bb39d660b88f63414.zip |
Notes
Diffstat (limited to 'ftp/tnftpd')
-rw-r--r-- | ftp/tnftpd/Makefile | 50 | ||||
-rw-r--r-- | ftp/tnftpd/distinfo | 6 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-configure.ac | 14 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-src-Makefile.am | 25 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-src-Makefile.in | 16 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-src-ftpd.c | 168 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-src-logutmp.c | 21 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-src-logwtmp.c | 21 | ||||
-rw-r--r-- | ftp/tnftpd/files/patch-tnftpd.h | 17 | ||||
-rw-r--r-- | ftp/tnftpd/files/pkg-message.in | 5 |
10 files changed, 172 insertions, 171 deletions
diff --git a/ftp/tnftpd/Makefile b/ftp/tnftpd/Makefile index fc73019100e9..5cefe02a1da4 100644 --- a/ftp/tnftpd/Makefile +++ b/ftp/tnftpd/Makefile @@ -6,65 +6,49 @@ # PORTNAME= tnftpd -PORTVERSION= 20080609 +PORTVERSION= 20100324 CATEGORIES= ftp ipv6 MASTER_SITES= ftp://ftp.netbsd.org/pub/NetBSD/misc/tnftp/ MAINTAINER= cejkar@fit.vutbr.cz COMMENT= Enhanced ftp server from NetBSD -GNU_CONFIGURE= yes - -CFLAGS+= -DSUPPORT_UTMP +USE_AUTOTOOLS= aclocal:110 automake:110 libtool:22 +ACLOCAL_ARGS= -I ${LOCALBASE}/share/aclocal .include <bsd.port.pre.mk> -.if ${OSVERSION} > 900007 -BROKEN= fails to build with new utmpx -.endif - -.if defined(WITH_SOCKS5) -BUILD_DEPENDS+= ${LOCALBASE}/lib/libsocks5.a:${PORTSDIR}/net/socks5 -CONFIGURE_ARGS+= --with-socks5 +.if ${OSVERSION} >= 900007 +CFLAGS+= -DSUPPORT_UTMPX +.else +CFLAGS+= -DSUPPORT_UTMP .endif MAN5= ftpd.conf.5 ftpusers.5 MAN8= tnftpd.8 PLIST_FILES= libexec/tnftpd PORTDOCS= ChangeLog NEWS README THANKS COPYING +PORTEXAMPLES= ftpd.conf ftpusers SUB_FILES= pkg-message -FIXPREFIX= ftpd.8 ftpd.conf.5 ftpusers.5 - -pre-patch: -.for f in ${FIXPREFIX} - ${REINPLACE_CMD} -e \ - "s@^\.Dq Pa /etc@.Dq Pa ${PREFIX}/etc@g; \ - s@^\.Pa /etc@.Pa ${PREFIX}/etc@g; \ - s@^\.It Pa /etc/@.It Pa ${PREFIX}/etc/@g; \ - s@^\.Ss /etc/@.Ss ${PREFIX}/etc/@g; \ - s@^\.Sx /etc/@.Sx ${PREFIX}/etc/@g; \ - s@^\.Bl -tag -width /etc/@.Bl -tag -width ${PREFIX}/etc/@g; \ - s@${PREFIX}/etc/shells@/etc/shells@g; \ - s@${PREFIX}/etc/nologin@/etc/nologin@g; \ - s@${PREFIX}/etc/pwd.db@/etc/pwd.db@g" \ - ${WRKSRC}/src/${f} -.endfor - ${REINPLACE_CMD} -e \ - "s@^#define _DEFAULT_CONFDIR \"/etc\"@#define _DEFAULT_CONFDIR \"${PREFIX}/etc\"@" \ - ${WRKSRC}/src/pathnames.h do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/tnftpd ${PREFIX}/libexec - ${INSTALL_MAN} ${WRKSRC}/src/ftpd.8 ${PREFIX}/man/man8/tnftpd.8 - ${INSTALL_MAN} ${WRKSRC}/src/ftpd.conf.5 ${PREFIX}/man/man5 - ${INSTALL_MAN} ${WRKSRC}/src/ftpusers.5 ${PREFIX}/man/man5 + ${INSTALL_MAN} ${WRKSRC}/src/ftpd.conf.man ${PREFIX}/man/man5/ftpd.conf.5 + ${INSTALL_MAN} ${WRKSRC}/src/ftpusers.man ${PREFIX}/man/man5/ftpusers.5 + ${INSTALL_MAN} ${WRKSRC}/src/tnftpd.man ${PREFIX}/man/man8/tnftpd.8 .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} .for f in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} .endfor .endif +.if !defined(NOPORTEXAMPLES) + ${MKDIR} ${EXAMPLESDIR} +.for f in ${PORTEXAMPLES} + ${INSTALL_DATA} ${WRKSRC}/examples/${f} ${EXAMPLESDIR} +.endfor +.endif post-install: @${CAT} ${PKGMESSAGE} diff --git a/ftp/tnftpd/distinfo b/ftp/tnftpd/distinfo index 3a214c0d407c..b9eefe212f91 100644 --- a/ftp/tnftpd/distinfo +++ b/ftp/tnftpd/distinfo @@ -1,3 +1,3 @@ -MD5 (tnftpd-20080609.tar.gz) = 9753e194b81357262581de12f07a76b5 -SHA256 (tnftpd-20080609.tar.gz) = 82f594afd58f70e4439c52262edefee7edbd8802d7feb86710e34cab2facdd7c -SIZE (tnftpd-20080609.tar.gz) = 244732 +MD5 (tnftpd-20100324.tar.gz) = 4a78a35483ae356969300dc35c9f4b98 +SHA256 (tnftpd-20100324.tar.gz) = ff6b7c39f1bbdb9686a2c92652a59e8c81f1268dd329ff582db91a8ed76c599c +SIZE (tnftpd-20100324.tar.gz) = 511110 diff --git a/ftp/tnftpd/files/patch-configure.ac b/ftp/tnftpd/files/patch-configure.ac new file mode 100644 index 000000000000..9383d31a434b --- /dev/null +++ b/ftp/tnftpd/files/patch-configure.ac @@ -0,0 +1,14 @@ +Feature silent-rules needs atleast autoconf 1.11, however we still have +at most autoconf 1.10 in ports tree (2010/09/10). + +--- configure.ac.orig 2010-03-24 13:31:39.000000000 +0100 ++++ configure.ac 2010-03-24 13:31:39.000000000 +0200 +@@ -18,7 +18,7 @@ + AC_CONFIG_HEADERS([tnftpd_config.h]) + AC_CONFIG_LIBOBJ_DIR([libnetbsd]) + +-AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules]) ++AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc]) + AM_MAINTAINER_MODE + + # diff --git a/ftp/tnftpd/files/patch-src-Makefile.am b/ftp/tnftpd/files/patch-src-Makefile.am new file mode 100644 index 000000000000..2c6cb3d0b9a0 --- /dev/null +++ b/ftp/tnftpd/files/patch-src-Makefile.am @@ -0,0 +1,25 @@ +FreeBSD does have support for utmp/utmpx, so include relevant files into +a build. + +--- src/Makefile.am.orig 2010-01-04 06:46:29.000000000 +0100 ++++ src/Makefile.am 2010-01-04 06:46:29.000000000 +0100 +@@ -7,7 +7,9 @@ + conf.c \ + ftpd.c \ + ftpcmd.y \ +- popen.c ++ popen.c \ ++ logutmp.c \ ++ logwtmp.c + + tnftpd_CPPFLAGS = \ + -DHAVE_TNFTPD_H=1 \ +@@ -45,8 +47,6 @@ + extern.h \ + ftpd.conf.manin \ + ftpusers.manin \ +- logutmp.c \ +- logwtmp.c \ + pathnames.h \ + tnftpd.manin \ + version.h diff --git a/ftp/tnftpd/files/patch-src-Makefile.in b/ftp/tnftpd/files/patch-src-Makefile.in deleted file mode 100644 index bce22d9f22a0..000000000000 --- a/ftp/tnftpd/files/patch-src-Makefile.in +++ /dev/null @@ -1,16 +0,0 @@ - -FreeBSD does have support for utmp/wtmp, so include relevant files into -a build. - ---- src/Makefile.in.orig 2008-03-09 16:51:35.000000000 -0400 -+++ src/Makefile.in 2008-03-09 16:51:35.000000000 -0400 -@@ -2,8 +2,7 @@ - # - - PROG = tnftpd@EXEEXT@ --SRCS = cmds.c conf.c ftpd.c ftpcmd.c popen.c @LSOBJS@ --# removed: logutmp.o logwtmp.o -+SRCS = cmds.c conf.c ftpd.c ftpcmd.c popen.c logutmp.c logwtmp.c @LSOBJS@ - - srcdir = @srcdir@ - VPATH = @srcdir@ diff --git a/ftp/tnftpd/files/patch-src-ftpd.c b/ftp/tnftpd/files/patch-src-ftpd.c index 2b968a6d06ca..76154a429b0a 100644 --- a/ftp/tnftpd/files/patch-src-ftpd.c +++ b/ftp/tnftpd/files/patch-src-ftpd.c @@ -1,109 +1,73 @@ -Add -C user@host support instead of just -C user and add support for -IPv6 in ftpusers. +Rewrite utmpx support. -FreeBSD does not have _PASSWORD_CHGNOW defined, so use direct constant -instead. - -We are sure, that we have good LOGIN_NAME_MAX from tnftpd.h, so use it -instead of unnecessarily conservative _POSIX_LOGIN_NAME_MAX. - ---- src/ftpd.c.orig 2008-06-08 20:52:33.000000000 -0400 -+++ src/ftpd.c 2008-06-08 20:52:33.000000000 -0400 -@@ -368,6 +368,24 @@ - break; +--- src/ftpd.c.orig 2009-11-07 04:26:48.000000000 +0100 ++++ src/ftpd.c 2009-11-07 04:26:48.000000000 +0100 +@@ -504,9 +504,6 @@ + confdir = _DEFAULT_CONFDIR; - case 'C': -+ if ((p = strchr(optarg, '@')) != NULL) { -+ *p++ = '\0'; -+ strlcpy(remotehost, p, MAXHOSTNAMELEN + 1); -+ if (inet_pton(AF_INET, p, -+ &his_addr.su_addr) == 1) { -+ his_addr.su_family = AF_INET; -+ his_addr.su_len = -+ sizeof(his_addr.si_su.su_sin); -+#ifdef INET6 -+ } else if (inet_pton(AF_INET6, p, -+ &his_addr.su_6addr) == 1) { -+ his_addr.su_family = AF_INET6; -+ his_addr.su_len = -+ sizeof(his_addr.si_su.su_sin6); -+#endif -+ } else -+ his_addr.su_family = AF_UNSPEC; -+ } - pw = sgetpwnam(optarg); - exit(checkaccess(optarg) ? 0 : 1); - /* NOTREACHED */ -@@ -497,12 +515,12 @@ - exit(1); - } else if (l <= 0) { - syslog(LOG_WARNING, "using conservative LOGIN_NAME_MAX value"); -- curname_len = _POSIX_LOGIN_NAME_MAX; -+ curname_len = LOGIN_NAME_MAX; - } else - curname_len = (size_t)l; - #else - /* using conservative LOGIN_NAME_MAX value */ -- curname_len = _POSIX_LOGIN_NAME_MAX; -+ curname_len = LOGIN_NAME_MAX; + if (dowtmp) { +-#ifdef SUPPORT_UTMPX +- ftpd_initwtmpx(); +-#endif + #ifdef SUPPORT_UTMP + ftpd_initwtmp(); #endif - curname = malloc(curname_len); - if (curname == NULL) { -@@ -1179,18 +1197,38 @@ - - /* have a host specifier */ - if ((p = strchr(word, '@')) != NULL) { -- unsigned long net, mask, addr; -- int bits; -+ char net[16], mask[16], *addr; -+ int addrlen, bits, bytes, a; - - *p++ = '\0'; - /* check against network or CIDR */ -- if (isdigit((unsigned char)*p) && -- (bits = inet_net_pton(AF_INET, p, -- &net, sizeof(net))) != -1) { -- net = ntohl(net); -- mask = 0xffffffffU << (32 - bits); -- addr = ntohl(his_addr.su_addr.s_addr); -- if ((addr & mask) != net) -+ memset(net, 0x00, sizeof(net)); -+ if ((bits = inet_net_pton(his_addr.su_family, p, net, -+ sizeof(net))) != -1) { -+#ifdef INET6 -+ if (his_addr.su_family == AF_INET) { -+#endif -+ addrlen = 4; -+ addr = (char *)&his_addr.su_addr; -+#ifdef INET6 -+ } else { -+ addrlen = 16; -+ addr = (char *)&his_addr.su_6addr; -+ } -+#endif -+ bytes = bits / 8; -+ bits = bits % 8; -+ if (bytes > 0) -+ memset(mask, 0xFF, bytes); -+ if (bytes < addrlen) -+ mask[bytes] = 0xFF << (8 - bits); -+ if (bytes + 1 < addrlen) -+ memset(mask + bytes + 1, 0x00, -+ addrlen - bytes - 1); -+ for (a = 0; a < addrlen; a++) -+ if ((addr[a] & mask[a]) != net[a]) -+ break; -+ if (a < addrlen) - continue; - - /* check against hostname glob */ -@@ -3776,7 +3814,7 @@ - expire = pwent->pw_expire; +@@ -1319,23 +1316,18 @@ + (void)gettimeofday(&tv, NULL); #endif - #if defined(HAVE_STRUCT_PASSWD_PW_CHANGE) -- change = (pwent->pw_change == _PASSWORD_CHGNOW)? now : pwent->pw_change; -+ change = (pwent->pw_change == -1)? now : pwent->pw_change; + #ifdef SUPPORT_UTMPX +- if (doutmp) { ++ if (doutmp || dowtmp) { + (void)memset(&utmpx, 0, sizeof(utmpx)); + utmpx.ut_tv = tv; + utmpx.ut_pid = getpid(); +- utmpx.ut_id[0] = 'f'; +- utmpx.ut_id[1] = 't'; +- utmpx.ut_id[2] = 'p'; +- utmpx.ut_id[3] = '*'; ++ snprintf(utmpx.ut_id, sizeof(utmpx.ut_id), "%xftp", ++ utmpx.ut_pid); + utmpx.ut_type = USER_PROCESS; +- (void)strncpy(utmpx.ut_name, name, sizeof(utmpx.ut_name)); ++ (void)strncpy(utmpx.ut_user, name, sizeof(utmpx.ut_user)); + (void)strncpy(utmpx.ut_line, line, sizeof(utmpx.ut_line)); + (void)strncpy(utmpx.ut_host, host, sizeof(utmpx.ut_host)); +- (void)memcpy(&utmpx.ut_ss, &haddr->si_su, haddr->su_len); +- ftpd_loginx(&utmpx); ++ (void)pututxline(&utmpx); + } +- if (dowtmp) +- ftpd_logwtmpx(line, name, host, haddr, 0, USER_PROCESS); #endif + #ifdef SUPPORT_UTMP + if (doutmp) { +@@ -1355,17 +1347,23 @@ + logout_utmp(void) + { + #ifdef SUPPORT_UTMPX +- int okwtmpx = dowtmp; ++ struct timeval tv; ++ (void)gettimeofday(&tv, NULL); #endif - + #ifdef SUPPORT_UTMP + int okwtmp = dowtmp; + #endif + if (logged_in) { + #ifdef SUPPORT_UTMPX +- if (doutmp) +- okwtmpx &= ftpd_logoutx(ttyline, 0, DEAD_PROCESS); +- if (okwtmpx) +- ftpd_logwtmpx(ttyline, "", "", NULL, 0, DEAD_PROCESS); ++ if (doutmp || dowtmp) { ++ (void)memset(&utmpx, 0, sizeof(utmpx)); ++ utmpx.ut_tv = tv; ++ utmpx.ut_pid = getpid(); ++ snprintf(utmpx.ut_id, sizeof(utmpx.ut_id), "%xftp", ++ utmpx.ut_pid); ++ utmpx.ut_type = DEAD_PROCESS; ++ (void)pututxline(&utmpx); ++ } + #endif + #ifdef SUPPORT_UTMP + if (doutmp) diff --git a/ftp/tnftpd/files/patch-src-logutmp.c b/ftp/tnftpd/files/patch-src-logutmp.c index 86c7cc2066fd..8f7162c5529e 100644 --- a/ftp/tnftpd/files/patch-src-logutmp.c +++ b/ftp/tnftpd/files/patch-src-logutmp.c @@ -1,21 +1,32 @@ FreeBSD does not have header file util.h, fortunately it is not needed. -Add header file time.h for time(). +Add header file time.h for time(). Rewrite utmpx support. ---- src/logutmp.c.orig 2006-12-04 16:13:22.000000000 -0500 -+++ src/logutmp.c 2006-12-04 16:13:22.000000000 -0500 -@@ -59,13 +59,13 @@ +--- src/logutmp.c.orig 2008-09-21 16:44:01.000000000 +0200 ++++ src/logutmp.c 2008-09-21 16:44:01.000000000 +0200 +@@ -71,13 +71,15 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <ttyent.h> #include <unistd.h> ++#ifdef SUPPORT_UTMP #include <utmp.h> ++#endif #ifdef SUPPORT_UTMPX #include <utmpx.h> #endif -#include <util.h> - #include "extern.h" + #endif /* !defined(HAVE_TNFTPD_H) */ +@@ -161,7 +163,7 @@ + } + #endif /* SUPPORT_UTMP */ + +-#ifdef SUPPORT_UTMPX ++#if 0 + /* + * special version of loginx which updates utmpx only. + */ diff --git a/ftp/tnftpd/files/patch-src-logwtmp.c b/ftp/tnftpd/files/patch-src-logwtmp.c index d9cc5ab38122..fd51f1a9b15a 100644 --- a/ftp/tnftpd/files/patch-src-logwtmp.c +++ b/ftp/tnftpd/files/patch-src-logwtmp.c @@ -2,11 +2,11 @@ FreeBSD does not have header file util.h, fortunately it is not needed. Add header files sys/socket.h and netdb.h for getaddrinfo() and getnameinfo(). If host name is longer than UT_HOSTSIZE (16 characters), log numeric -address to utmp. +address to utmp. Rewrite utmpx support. ---- src/logwtmp.c.orig 2008-05-31 23:26:12.000000000 -0400 -+++ src/logwtmp.c 2008-05-31 23:26:12.000000000 -0400 -@@ -43,11 +43,13 @@ +--- src/logwtmp.c.orig 2008-09-21 16:44:01.000000000 +0200 ++++ src/logwtmp.c 2008-09-21 16:44:01.000000000 +0200 +@@ -46,11 +46,13 @@ #include <sys/types.h> #include <sys/param.h> @@ -20,7 +20,7 @@ address to utmp. #include <signal.h> #include <stdio.h> #include <string.h> -@@ -60,7 +62,6 @@ +@@ -63,7 +65,6 @@ #ifdef SUPPORT_UTMPX #include <utmpx.h> #endif @@ -28,7 +28,7 @@ address to utmp. #ifdef KERBEROS5 #include <krb5/krb5.h> -@@ -90,6 +91,26 @@ +@@ -95,6 +96,26 @@ struct utmp ut; struct stat buf; @@ -55,3 +55,12 @@ address to utmp. if (fd < 0) return; if (fstat(fd, &buf) == 0) { +@@ -109,7 +130,7 @@ + } + #endif + +-#ifdef SUPPORT_UTMPX ++#if 0 + static int fdx = -1; + + void diff --git a/ftp/tnftpd/files/patch-tnftpd.h b/ftp/tnftpd/files/patch-tnftpd.h index 9164f1eb1c42..9eb5aa126986 100644 --- a/ftp/tnftpd/files/patch-tnftpd.h +++ b/ftp/tnftpd/files/patch-tnftpd.h @@ -1,10 +1,19 @@ FreeBSD does not have LOGIN_NAME_MAX, but it has MAXLOGNAME instead, -so use it as much as possible. +so use it as much as possible. Rewrite utmpx support. ---- tnftpd.h.orig 2008-06-08 21:24:51.000000000 -0400 -+++ tnftpd.h 2008-06-08 21:24:51.000000000 -0400 -@@ -548,8 +548,12 @@ +--- tnftpd.h.orig 2009-11-07 10:59:09.000000000 +0100 ++++ tnftpd.h 2009-11-07 10:59:09.000000000 +0100 +@@ -119,6 +119,8 @@ + #endif + #if defined(HAVE_UTMP_H) + # include <utmp.h> ++#else ++# include <utmpx.h> + #endif + + #if defined(HAVE_POLL) +@@ -561,8 +563,12 @@ #define TM_YEAR_BASE 1900 #if !defined(LOGIN_NAME_MAX) diff --git a/ftp/tnftpd/files/pkg-message.in b/ftp/tnftpd/files/pkg-message.in index 07752592032f..71e871b3cafe 100644 --- a/ftp/tnftpd/files/pkg-message.in +++ b/ftp/tnftpd/files/pkg-message.in @@ -4,6 +4,7 @@ At the very least, create a ftpusers file with the usernams of users you don't want to connect (root, toor, etc.). This will allow non-listed users to log in. Copying /etc/ftpusers to %%PREFIX%%/etc/ftpusers should be sufficient. -See the man files for more information. The man- and configuration files for -FreeBSD's built-in ftpd can also be of use as examples/additional info. +See the man pages and examples in %%EXAMPLESDIR%% for more +information. The man pages and configuration files for FreeBSD's built-in ftpd +can also be of use as examples/additional info. ================================================================================ |