diff --git a/ftp/proftpd-devel/Makefile b/ftp/proftpd-devel/Makefile index fc13ea8ed65a..d2828cd4c720 100644 --- a/ftp/proftpd-devel/Makefile +++ b/ftp/proftpd-devel/Makefile @@ -6,8 +6,7 @@ # PORTNAME= proftpd -DISTVERSION= 1.3.0 -PORTREVISION= 5 +DISTVERSION= 1.3.1rc1 CATEGORIES= ftp MASTER_SITES= ftp://ftp.proftpd.org/distrib/source/ \ ftp://ftp.fastorama.com/mirrors/ftp.proftpd.org/distrib/source/ \ @@ -26,12 +25,13 @@ MAN8= proftpd.8 ftpshut.8 ftpdctl.8 PORTDOCSdoc= Configuration.html faq.html PORTDOCScontrib=mod_ifsession.html mod_radius.html mod_rewrite.html \ - mod_tls.html mod_wrap.html ftpasswd.html + mod_tls.html mod_wrap2.html mod_wrap2_file.html mod_wrap2_sql.html \ + mod_ban.html mod_quotatab_radius.html ftpasswd.html PORTDOCS= ${PORTDOCSdoc} ${PORTDOCScontrib} USE_GMAKE= yes -GNU_CONFIGURE= yes USE_BZIP2= yes +GNU_CONFIGURE=yes USE_RC_SUBR= proftpd.sh @@ -49,9 +49,16 @@ OPTIONS= IPV6 "Use IPv6" off \ IFSESSION "Include mod_ifsession" on \ README "Include mod_readme" on \ RATIO "Include mod_ratio" on \ + CTRLS "include controls" off \ REWRITE "Include mod_rewrite" on \ - WRAP "Include mod_wrap" on \ - RADIUS "Include mod_radius" off + WRAP "Include mod_wrap2" on \ + WRAP_FILE "include mod_wrap2_file" off \ + WRAP_SQL "include mod_wrap2_sql" off \ + LANG "include mod_lang" off \ + RADIUS "Include mod_radius" off \ + QUOTATAB_RADIUS "include mod_quotatab_radius" off \ + BAN "include mod_ban (Requires CTRLS)" off \ + NLS "Use nls" off MODULES?= @@ -59,7 +66,6 @@ MODULES?= .if ${OSVERSION} < 500000 CONFIGURE_ARGS+= --without-getopt -EXTRA_PATCHES= ${FILESDIR}/extra_patch-configure.in USE_AUTOTOOLS= autoconf:259 .endif @@ -76,13 +82,39 @@ MODULES:=${MODULES}:mod_rewrite .endif .if !defined(WITHOUT_WRAP) -MODULES:=${MODULES}:mod_wrap +MODULES:=${MODULES}:mod_wrap2 +INCLUDEDIRS:=${INCLUDEDIRS}:${WORKDIR}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +.endif + +.if defined(WITH_WRAP_FILE) +INCLUDEDIRS:=${INCLUDEDIRS}:${LOCALBASE}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +MODULES:=${MODULES}:mod_wrap2_file +.endif + +.if defined(WITH_WRAP_SQL) +INCLUDEDIRS:=${INCLUDEDIRS}:${LOCALBASE}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +MODULES:=${MODULES}:mod_wrap2_sql .endif .if defined(WITH_RADIUS) MODULES:=${MODULES}:mod_radius .endif +.if defined(WITH_QUOTATAB_RADIUS) +MODULES:=${MODULES}:mod_quotatab_radius +.endif + +.if defined(WITH_LANG) +MODULES:=${MODULES}:mod_lang +.endif + +.if defined(WITH_BAN) +MODULES:=${MODULES}:mod_ban +.endif + .if defined(WITH_SETPASSENT) CONFIGURE_ARGS+= --enable-force-setpassent .endif @@ -99,6 +131,12 @@ CONFIGURE_ARGS+= --enable-ipv6 CONFIGURE_ARGS+= --disable-ipv6 .endif +.if defined(WITH_NLS) +INCLUDEDIRS:=${INCLUDEDIRS}:${LOCALBASE}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +CONFIGURE_ARGS+= --enable-nls +.endif + #allow user to override MODULES?= mod_ratio:mod_readme:mod_rewrite:mod_wrap:mod_ifsession @@ -210,4 +248,8 @@ post-install: @${INSTALL_MAN} ${WRKSRC}/src/ftpdctl.8 ${PREFIX}/man/man8/ftpdctl.8 .endif +.if ${OSVERSION} < 500000 +BROKEN= Does not compile on 4.x +.endif + .include diff --git a/ftp/proftpd-devel/distinfo b/ftp/proftpd-devel/distinfo index e9d4f19c0005..495d7a9380cc 100644 --- a/ftp/proftpd-devel/distinfo +++ b/ftp/proftpd-devel/distinfo @@ -1,3 +1,3 @@ -MD5 (proftpd-1.3.0.tar.bz2) = fae47d01b52e035eb6b7190e74c17722 -SHA256 (proftpd-1.3.0.tar.bz2) = 83f220cba64455a2b1701b97ce9896f66a0020b179c50daf4860cdf362464ffe -SIZE (proftpd-1.3.0.tar.bz2) = 1386086 +MD5 (proftpd-1.3.1rc1.tar.bz2) = 08f4d526b46c84f10e9634d2d913052c +SHA256 (proftpd-1.3.1rc1.tar.bz2) = 32cf852535c2ec55c5833c2766cbd0c6aba950ab2967565606e1df334736a766 +SIZE (proftpd-1.3.1rc1.tar.bz2) = 1484138 diff --git a/ftp/proftpd-devel/files/extra_patch-configure.in b/ftp/proftpd-devel/files/extra_patch-configure.in deleted file mode 100644 index c40394099c3b..000000000000 --- a/ftp/proftpd-devel/files/extra_patch-configure.in +++ /dev/null @@ -1,37 +0,0 @@ ---- configure.in Thu Mar 9 09:12:35 2006 -+++ configure.in Mon May 22 15:01:23 2006 -@@ -161,12 +161,14 @@ - [ - if test "$withval" != "no" ; then - LIB_OBJS="$LIB_OBJS getopt.o getopt1.o" -- AC_CHECK_FUNCS(getopt) -+ AC_CHECK_FUNCS(getopt getopt_long) -+ AC_CHECK_HEADERS(getopt.h) - fi - ], - [ - LIB_OBJS="$LIB_OBJS getopt.o getopt1.o" -- AC_CHECK_FUNCS(getopt) -+ AC_CHECK_FUNCS(getopt getopt_long) -+ AC_CHECK_HEADERS(getopt.h) - ]) - - dnl Modules...'nuff said. -@@ -850,7 +852,7 @@ - ac_build_static_modules="modules/mod_cap.o $ac_build_static_modules" - fi - --AC_CHECK_HEADERS(ctype.h getopt.h crypt.h bstring.h iconv.h inttypes.h langinfo.h limits.h) -+AC_CHECK_HEADERS(ctype.h crypt.h bstring.h iconv.h inttypes.h langinfo.h limits.h) - AC_CHECK_HEADERS(string.h strings.h stropts.h) - AC_CHECK_HEADERS(sys/file.h sys/mman.h sys/types.h sys/uio.h) - -@@ -1110,7 +1112,7 @@ - ) - - AC_CHECK_FUNCS(getcwd getenv gethostbyname2 gethostname getnameinfo) --AC_CHECK_FUNCS(getopt_long gettimeofday hstrerror inet_aton inet_ntop inet_pton) -+AC_CHECK_FUNCS(gettimeofday hstrerror inet_aton inet_ntop inet_pton) - AC_CHECK_FUNCS(memcpy mempcpy mkdir mkstemp mlock mlockall munlock munlockall) - AC_CHECK_FUNCS(rmdir select setgroups socket statfs strchr strcoll strerror) - AC_CHECK_FUNCS(strsep strtol strtoull setprotoent setspent endprotoent) diff --git a/ftp/proftpd-devel/files/extra_patch-ldap-tls-mod_ldap.c b/ftp/proftpd-devel/files/extra_patch-ldap-tls-mod_ldap.c index 3b965f91c6c3..b4a9e5427f59 100644 --- a/ftp/proftpd-devel/files/extra_patch-ldap-tls-mod_ldap.c +++ b/ftp/proftpd-devel/files/extra_patch-ldap-tls-mod_ldap.c @@ -1,8 +1,11 @@ ---- contrib/mod_ldap.c Fri Apr 21 10:31:23 2006 -+++ contrib/mod_ldap.c Fri Apr 21 10:31:43 2006 -@@ -55,7 +55,7 @@ +--- contrib/mod_ldap.c.orig Thu Oct 19 18:18:07 2006 ++++ contrib/mod_ldap.c Fri Dec 15 11:01:21 2006 +@@ -60,7 +60,7 @@ * after connecting to the LDAP server. If TLS cannot be enabled, the LDAP * connection will fail. */ -/* #define USE_LDAP_TLS */ -+#define USE_LDAP_TLS ++#define USE_LDAP_TLS */ + + /* + * If you have to edit anything below this line, it's a bug. Report it diff --git a/ftp/proftpd-devel/files/patch-contrib::mod_sql_mysql.c b/ftp/proftpd-devel/files/patch-contrib::mod_sql_mysql.c index 9da89767a223..2f495ff0b86a 100644 --- a/ftp/proftpd-devel/files/patch-contrib::mod_sql_mysql.c +++ b/ftp/proftpd-devel/files/patch-contrib::mod_sql_mysql.c @@ -1,11 +1,11 @@ ---- contrib/mod_sql_mysql.c.orig Sun Nov 2 00:30:13 2003 -+++ contrib/mod_sql_mysql.c Sun Nov 2 00:30:23 2003 -@@ -134,7 +134,7 @@ - - #define _MYSQL_PORT "3306" - --#include -+#include +--- contrib/mod_sql_mysql.c.orig Tue Dec 12 19:52:15 2006 ++++ contrib/mod_sql_mysql.c Tue Dec 12 20:02:56 2006 +@@ -135,7 +135,7 @@ #include "conf.h" #include "../contrib/mod_sql.h" +-#include ++#include + + /* + * timer-handling code adds the need for a couple of forward declarations diff --git a/ftp/proftpd-devel/files/patch-main.c b/ftp/proftpd-devel/files/patch-main.c deleted file mode 100644 index eb948cc779aa..000000000000 --- a/ftp/proftpd-devel/files/patch-main.c +++ /dev/null @@ -1,46 +0,0 @@ ---- src/main.c.orig Wed Mar 15 19:41:01 2006 -+++ src/main.c Wed Nov 15 19:06:18 2006 -@@ -116,6 +116,8 @@ - - static char sbuf[PR_TUNABLE_BUFFER_SIZE] = {'\0'}; - -+#define PR_DEFAULT_CMD_BUFSZ 512 -+ - static char **Argv = NULL; - static char *LastArgv = NULL; - static const char *PidPath = PR_PID_FILE_PATH; -@@ -820,16 +822,25 @@ - pr_timer_reset(TIMER_IDLE, NULL); - - if (cmd_buf_size == -1) { -- long *buf_size = get_param_ptr(main_server->conf, -- "CommandBufferSize", FALSE); -- -- if (buf_size == NULL || *buf_size <= 0) -- cmd_buf_size = 512; -+ int *bufsz = get_param_ptr(main_server->conf, "CommandBufferSize", -+ FALSE); - -- else if (*buf_size + 1 > sizeof(buf)) { -- pr_log_pri(PR_LOG_WARNING, "Invalid CommandBufferSize size given. " -- "Resetting to 512."); -- cmd_buf_size = 512; -+ if (bufsz == NULL || -+ *bufsz <= 0) { -+ pr_log_pri(PR_LOG_WARNING, "invalid CommandBufferSize size " -+ "given, resetting to default buffer size (%u)", -+ (unsigned int) PR_DEFAULT_CMD_BUFSZ); -+ cmd_buf_size = PR_DEFAULT_CMD_BUFSZ; -+ -+ } else if (*bufsz + 1 > sizeof(buf)) { -+ pr_log_pri(PR_LOG_WARNING, "invalid CommandBufferSize size (%d) " -+ "given, resetting to default buffer size (%u)", -+ *bufsz, (unsigned int) PR_DEFAULT_CMD_BUFSZ); -+ cmd_buf_size = PR_DEFAULT_CMD_BUFSZ; -+ -+ } else { -+ pr_log_debug(DEBUG1, "setting CommandBufferSize to %d", *bufsz); -+ cmd_buf_size = (long) *bufsz; - } - } - diff --git a/ftp/proftpd-devel/files/patch-mod_tls.c b/ftp/proftpd-devel/files/patch-mod_tls.c deleted file mode 100644 index 61b62a827fef..000000000000 --- a/ftp/proftpd-devel/files/patch-mod_tls.c +++ /dev/null @@ -1,38 +0,0 @@ -diff -u -r1.100 mod_tls.c ---- contrib/mod_tls.c 29 Nov 2006 03:47:56 -0000 1.100 -+++ contrib/mod_tls.c 29 Nov 2006 04:09:06 -0000 -@@ -3103,17 +3103,25 @@ - long datalen = 0; - int ok; - -- if ((ok = X509_NAME_print_ex(mem, x509_name, 0, XN_FLAG_ONELINE))) -- datalen = BIO_get_mem_data(mem, &data); -+ ok = X509_NAME_print_ex(mem, x509_name, 0, XN_FLAG_ONELINE); -+ if (ok) { -+ datalen = BIO_get_mem_data(mem, &data); - -- if (data) { -- memset(&buf, '\0', sizeof(buf)); -- memcpy(buf, data, datalen); -- buf[datalen] = '\0'; -- buf[sizeof(buf)-1] = '\0'; -+ if (data) { -+ memset(&buf, '\0', sizeof(buf)); - -- BIO_free(mem); -- return buf; -+ if (datalen >= sizeof(buf)) { -+ datalen = sizeof(buf)-1; -+ } -+ -+ memcpy(buf, data, datalen); -+ -+ buf[datalen] = '\0'; -+ buf[sizeof(buf)-1] = '\0'; -+ -+ BIO_free(mem); -+ return buf; -+ } - } - - BIO_free(mem); diff --git a/ftp/proftpd-devel/files/patch-support.c b/ftp/proftpd-devel/files/patch-support.c deleted file mode 100644 index b4066f378711..000000000000 --- a/ftp/proftpd-devel/files/patch-support.c +++ /dev/null @@ -1,79 +0,0 @@ ---- src/support.c 2005/09/28 02:06:26 1.78 -+++ src/support.c 2006/11/27 14:49:47 1.80 -@@ -27,7 +27,7 @@ - /* Various basic support routines for ProFTPD, used by all modules - * and not specific to one or another. - * -- * $Id: support.c,v 1.78 2005/09/28 02:06:26 castaglia Exp $ -+ * $Id: support.c,v 1.80 2006/11/27 14:49:47 jwm Exp $ - */ - - #include "conf.h" -@@ -632,7 +632,8 @@ - char **mptr,**rptr; - char *marr[33],*rarr[33]; - char buf[PR_TUNABLE_PATH_MAX] = {'\0'}, *pbuf = NULL; -- size_t mlen = 0, rlen = 0, blen; -+ size_t mlen = 0, rlen = 0; -+ int blen; - int dyn = TRUE; - - cp = buf; -@@ -646,7 +647,7 @@ - - while ((m = va_arg(args, char *)) != NULL && mlen < sizeof(marr)-1) { - char *tmp = NULL; -- size_t count = 0; -+ int count = 0; - - if ((r = va_arg(args, char *)) == NULL) - break; -@@ -659,6 +660,12 @@ - while (tmp) { - pr_signals_handle(); - count++; -+ if (count < 0) { -+ /* Integer overflow. In order to overflow integer range with a count -+ * of escapes, somebody must be doing something very strange. -+ */ -+ return s; -+ } - - /* Be sure to increment the pointer returned by strstr(3), to - * advance past the beginning of the substring for which we are -@@ -674,6 +681,12 @@ - */ - if (count) { - blen += count * (strlen(r) - strlen(m)); -+ if (blen < 0) { -+ /* Integer overflow. In order to overflow this, somebody must be -+ * doing something very strange. -+ */ -+ return s; -+ } - marr[mlen] = m; - rarr[mlen++] = r; - } -@@ -722,10 +735,11 @@ - } - - if (!*mptr) { -- if ((cp - pbuf + 1) > blen) { -+ if ((cp - pbuf + 1) >= blen) { - pr_log_pri(PR_LOG_ERR, - "WARNING: attempt to overflow internal ProFTPD buffers"); - cp = pbuf + blen - 1; -+ goto done; - } - *cp++ = *src++; - } -@@ -768,6 +782,9 @@ - char *sstrcat(char *dest, const char *src, size_t n) { - register char *d; - -+ if (n == 0) -+ return NULL; -+ - for (d = dest; *d && n > 1; d++, n--) ; - - while (n-- > 1 && *src) diff --git a/ftp/proftpd-devel/files/patch-utf8.c b/ftp/proftpd-devel/files/patch-utf8.c new file mode 100644 index 000000000000..f8328dadc380 --- /dev/null +++ b/ftp/proftpd-devel/files/patch-utf8.c @@ -0,0 +1,110 @@ +--- src/utf8.c.orig Wed Jun 14 15:33:19 2006 ++++ src/utf8.c Wed Dec 13 08:40:35 2006 +@@ -23,7 +23,7 @@ + */ + + /* UTF8 encoding/decoding +- * $Id: utf8.c,v 1.3 2006/06/14 23:33:19 castaglia Exp $ ++ * $Id: utf8.c,v 1.4 2006/12/13 17:40:35 castaglia Exp $ + */ + + #include "conf.h" +@@ -38,12 +38,13 @@ + # include + #endif + ++#ifdef HAVE_ICONV_H + static iconv_t decode_conv = (iconv_t) -1; + static iconv_t encode_conv = (iconv_t) -1; + + static int utf8_convert(iconv_t conv, char *inbuf, size_t *inbuflen, + char *outbuf, size_t *outbuflen) { +-#ifdef HAVE_ICONV ++# ifdef HAVE_ICONV + char *start = inbuf; + + while (inbuflen > 0) { +@@ -61,14 +62,14 @@ + break; + } + return 0; +-#else ++# else + errno = ENOSYS; + return -1; +-#endif /* HAVE_ICONV */ ++# endif /* HAVE_ICONV */ + } + + int utf8_free(void) { +-#ifdef HAVE_ICONV ++# ifdef HAVE_ICONV + int res; + + /* Close the iconv handles. */ +@@ -81,10 +82,10 @@ + return -1; + + return 0; +-#else ++# else + errno = ENOSYS; + return -1; +-#endif ++# endif + } + + int utf8_init(void) { +@@ -111,7 +112,7 @@ + "conversion"); + #endif /* HAVE_NL_LANGINFO */ + +-#ifdef HAVE_ICONV ++# ifdef HAVE_ICONV + /* Get the iconv handles. */ + encode_conv = iconv_open(local_charset, "UTF-8"); + if (encode_conv == (iconv_t) -1) +@@ -122,13 +123,15 @@ + return -1; + + return 0; +-#else ++# else + errno = ENOSYS; + return -1; +-#endif /* HAVE_ICONV */ ++# endif /* HAVE_ICONV */ + } ++#endif /* !HAVE_ICONV_H */ + + char *pr_utf8_decode(pool *p, const char *in, size_t inlen, size_t *outlen) { ++#ifdef HAVE_ICONV_H + size_t inbuflen, outbuflen; + char *inbuf, outbuf[PR_TUNABLE_PATH_MAX*2], *res = NULL; + +@@ -156,9 +159,14 @@ + memcpy(res, outbuf, *outlen); + + return res; ++#else ++ pr_trace_msg("utf8", 1, "missing iconv support, no UTF8 decoding possible"); ++ return pstrdup(p, in); ++#endif /* !HAVE_ICONV_H */ + } + + char *pr_utf8_encode(pool *p, const char *in, size_t inlen, size_t *outlen) { ++#ifdef HAVE_ICONV_H + size_t inbuflen, outbuflen; + char *inbuf, outbuf[PR_TUNABLE_PATH_MAX*2], *res; + +@@ -186,6 +194,10 @@ + memcpy(res, outbuf, *outlen); + + return res; ++#else ++ pr_trace_msg("utf8", 1, "missing iconv support, no UTF8 encoding possible"); ++ return pstrdup(p, in); ++#endif /* !HAVE_ICONV_H */ + } + + #endif /* PR_USE_NLS */ diff --git a/ftp/proftpd-devel/pkg-plist b/ftp/proftpd-devel/pkg-plist index 61c08dc01ad8..b4a7328f638f 100644 --- a/ftp/proftpd-devel/pkg-plist +++ b/ftp/proftpd-devel/pkg-plist @@ -2,11 +2,62 @@ bin/ftpcount bin/ftpdctl bin/ftptop bin/ftpwho -@unexec if cmp -s %D/etc/proftpd.conf %D/%%EXAMPLESDIR%%/etc/proftpd.conf; then rm -f %D/etc/proftpd.conf; fi -%%EXAMPLESDIR%%/etc/proftpd.conf -@exec if [ ! -f %D/etc/proftpd.conf ] ; then cp -p %D/%F %B/proftpd.conf; fi +etc/proftpd.conf +include/proftpd/auth.h +include/proftpd/bindings.h +include/proftpd/buildstamp.h +include/proftpd/child.h +include/proftpd/class.h +include/proftpd/compat.h +include/proftpd/conf.h +include/proftpd/config.h +include/proftpd/ctrls.h +include/proftpd/data.h +include/proftpd/default_paths.h +include/proftpd/dirtree.h +include/proftpd/display.h +include/proftpd/event.h +include/proftpd/feat.h +include/proftpd/fsio.h +include/proftpd/ftp.h +include/proftpd/glibc-glob.h +include/proftpd/help.h +include/proftpd/ident.h +include/proftpd/inet.h +include/proftpd/lastlog.h +include/proftpd/libsupp.h +include/proftpd/log.h +include/proftpd/mkhome.h +include/proftpd/mod_ctrls.h +include/proftpd/mod_wrap2.h +include/proftpd/modules.h +include/proftpd/netacl.h +include/proftpd/netaddr.h +include/proftpd/netio.h +include/proftpd/options.h +include/proftpd/parser.h +include/proftpd/pool.h +include/proftpd/pr-syslog.h +include/proftpd/privs.h +include/proftpd/proftpd.h +include/proftpd/regexp.h +include/proftpd/response.h +include/proftpd/scoreboard.h +include/proftpd/sets.h +include/proftpd/support.h +include/proftpd/table.h +include/proftpd/timers.h +include/proftpd/trace.h +include/proftpd/utf8.h +include/proftpd/var.h +include/proftpd/version.h +include/proftpd/xferlog.h sbin/ftpshut sbin/in.proftpd sbin/proftpd +@unexec if cmp -s %D/etc/proftpd.conf %D/%%EXAMPLESDIR%%/etc/proftpd.conf; then rm -f %D/etc/proftpd.conf; fi +%%EXAMPLESDIR%%/etc/proftpd.conf +@exec if [ ! -f %D/etc/proftpd.conf ] ; then cp -p %D/%F %B/proftpd.conf; fi @dirrm %%EXAMPLESDIR%%/etc @dirrm %%EXAMPLESDIR%% +@dirrm include/proftpd diff --git a/ftp/proftpd/Makefile b/ftp/proftpd/Makefile index fc13ea8ed65a..d2828cd4c720 100644 --- a/ftp/proftpd/Makefile +++ b/ftp/proftpd/Makefile @@ -6,8 +6,7 @@ # PORTNAME= proftpd -DISTVERSION= 1.3.0 -PORTREVISION= 5 +DISTVERSION= 1.3.1rc1 CATEGORIES= ftp MASTER_SITES= ftp://ftp.proftpd.org/distrib/source/ \ ftp://ftp.fastorama.com/mirrors/ftp.proftpd.org/distrib/source/ \ @@ -26,12 +25,13 @@ MAN8= proftpd.8 ftpshut.8 ftpdctl.8 PORTDOCSdoc= Configuration.html faq.html PORTDOCScontrib=mod_ifsession.html mod_radius.html mod_rewrite.html \ - mod_tls.html mod_wrap.html ftpasswd.html + mod_tls.html mod_wrap2.html mod_wrap2_file.html mod_wrap2_sql.html \ + mod_ban.html mod_quotatab_radius.html ftpasswd.html PORTDOCS= ${PORTDOCSdoc} ${PORTDOCScontrib} USE_GMAKE= yes -GNU_CONFIGURE= yes USE_BZIP2= yes +GNU_CONFIGURE=yes USE_RC_SUBR= proftpd.sh @@ -49,9 +49,16 @@ OPTIONS= IPV6 "Use IPv6" off \ IFSESSION "Include mod_ifsession" on \ README "Include mod_readme" on \ RATIO "Include mod_ratio" on \ + CTRLS "include controls" off \ REWRITE "Include mod_rewrite" on \ - WRAP "Include mod_wrap" on \ - RADIUS "Include mod_radius" off + WRAP "Include mod_wrap2" on \ + WRAP_FILE "include mod_wrap2_file" off \ + WRAP_SQL "include mod_wrap2_sql" off \ + LANG "include mod_lang" off \ + RADIUS "Include mod_radius" off \ + QUOTATAB_RADIUS "include mod_quotatab_radius" off \ + BAN "include mod_ban (Requires CTRLS)" off \ + NLS "Use nls" off MODULES?= @@ -59,7 +66,6 @@ MODULES?= .if ${OSVERSION} < 500000 CONFIGURE_ARGS+= --without-getopt -EXTRA_PATCHES= ${FILESDIR}/extra_patch-configure.in USE_AUTOTOOLS= autoconf:259 .endif @@ -76,13 +82,39 @@ MODULES:=${MODULES}:mod_rewrite .endif .if !defined(WITHOUT_WRAP) -MODULES:=${MODULES}:mod_wrap +MODULES:=${MODULES}:mod_wrap2 +INCLUDEDIRS:=${INCLUDEDIRS}:${WORKDIR}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +.endif + +.if defined(WITH_WRAP_FILE) +INCLUDEDIRS:=${INCLUDEDIRS}:${LOCALBASE}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +MODULES:=${MODULES}:mod_wrap2_file +.endif + +.if defined(WITH_WRAP_SQL) +INCLUDEDIRS:=${INCLUDEDIRS}:${LOCALBASE}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +MODULES:=${MODULES}:mod_wrap2_sql .endif .if defined(WITH_RADIUS) MODULES:=${MODULES}:mod_radius .endif +.if defined(WITH_QUOTATAB_RADIUS) +MODULES:=${MODULES}:mod_quotatab_radius +.endif + +.if defined(WITH_LANG) +MODULES:=${MODULES}:mod_lang +.endif + +.if defined(WITH_BAN) +MODULES:=${MODULES}:mod_ban +.endif + .if defined(WITH_SETPASSENT) CONFIGURE_ARGS+= --enable-force-setpassent .endif @@ -99,6 +131,12 @@ CONFIGURE_ARGS+= --enable-ipv6 CONFIGURE_ARGS+= --disable-ipv6 .endif +.if defined(WITH_NLS) +INCLUDEDIRS:=${INCLUDEDIRS}:${LOCALBASE}/include +LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib +CONFIGURE_ARGS+= --enable-nls +.endif + #allow user to override MODULES?= mod_ratio:mod_readme:mod_rewrite:mod_wrap:mod_ifsession @@ -210,4 +248,8 @@ post-install: @${INSTALL_MAN} ${WRKSRC}/src/ftpdctl.8 ${PREFIX}/man/man8/ftpdctl.8 .endif +.if ${OSVERSION} < 500000 +BROKEN= Does not compile on 4.x +.endif + .include diff --git a/ftp/proftpd/distinfo b/ftp/proftpd/distinfo index e9d4f19c0005..495d7a9380cc 100644 --- a/ftp/proftpd/distinfo +++ b/ftp/proftpd/distinfo @@ -1,3 +1,3 @@ -MD5 (proftpd-1.3.0.tar.bz2) = fae47d01b52e035eb6b7190e74c17722 -SHA256 (proftpd-1.3.0.tar.bz2) = 83f220cba64455a2b1701b97ce9896f66a0020b179c50daf4860cdf362464ffe -SIZE (proftpd-1.3.0.tar.bz2) = 1386086 +MD5 (proftpd-1.3.1rc1.tar.bz2) = 08f4d526b46c84f10e9634d2d913052c +SHA256 (proftpd-1.3.1rc1.tar.bz2) = 32cf852535c2ec55c5833c2766cbd0c6aba950ab2967565606e1df334736a766 +SIZE (proftpd-1.3.1rc1.tar.bz2) = 1484138 diff --git a/ftp/proftpd/files/extra_patch-configure.in b/ftp/proftpd/files/extra_patch-configure.in deleted file mode 100644 index c40394099c3b..000000000000 --- a/ftp/proftpd/files/extra_patch-configure.in +++ /dev/null @@ -1,37 +0,0 @@ ---- configure.in Thu Mar 9 09:12:35 2006 -+++ configure.in Mon May 22 15:01:23 2006 -@@ -161,12 +161,14 @@ - [ - if test "$withval" != "no" ; then - LIB_OBJS="$LIB_OBJS getopt.o getopt1.o" -- AC_CHECK_FUNCS(getopt) -+ AC_CHECK_FUNCS(getopt getopt_long) -+ AC_CHECK_HEADERS(getopt.h) - fi - ], - [ - LIB_OBJS="$LIB_OBJS getopt.o getopt1.o" -- AC_CHECK_FUNCS(getopt) -+ AC_CHECK_FUNCS(getopt getopt_long) -+ AC_CHECK_HEADERS(getopt.h) - ]) - - dnl Modules...'nuff said. -@@ -850,7 +852,7 @@ - ac_build_static_modules="modules/mod_cap.o $ac_build_static_modules" - fi - --AC_CHECK_HEADERS(ctype.h getopt.h crypt.h bstring.h iconv.h inttypes.h langinfo.h limits.h) -+AC_CHECK_HEADERS(ctype.h crypt.h bstring.h iconv.h inttypes.h langinfo.h limits.h) - AC_CHECK_HEADERS(string.h strings.h stropts.h) - AC_CHECK_HEADERS(sys/file.h sys/mman.h sys/types.h sys/uio.h) - -@@ -1110,7 +1112,7 @@ - ) - - AC_CHECK_FUNCS(getcwd getenv gethostbyname2 gethostname getnameinfo) --AC_CHECK_FUNCS(getopt_long gettimeofday hstrerror inet_aton inet_ntop inet_pton) -+AC_CHECK_FUNCS(gettimeofday hstrerror inet_aton inet_ntop inet_pton) - AC_CHECK_FUNCS(memcpy mempcpy mkdir mkstemp mlock mlockall munlock munlockall) - AC_CHECK_FUNCS(rmdir select setgroups socket statfs strchr strcoll strerror) - AC_CHECK_FUNCS(strsep strtol strtoull setprotoent setspent endprotoent) diff --git a/ftp/proftpd/files/extra_patch-ldap-tls-mod_ldap.c b/ftp/proftpd/files/extra_patch-ldap-tls-mod_ldap.c index 3b965f91c6c3..b4a9e5427f59 100644 --- a/ftp/proftpd/files/extra_patch-ldap-tls-mod_ldap.c +++ b/ftp/proftpd/files/extra_patch-ldap-tls-mod_ldap.c @@ -1,8 +1,11 @@ ---- contrib/mod_ldap.c Fri Apr 21 10:31:23 2006 -+++ contrib/mod_ldap.c Fri Apr 21 10:31:43 2006 -@@ -55,7 +55,7 @@ +--- contrib/mod_ldap.c.orig Thu Oct 19 18:18:07 2006 ++++ contrib/mod_ldap.c Fri Dec 15 11:01:21 2006 +@@ -60,7 +60,7 @@ * after connecting to the LDAP server. If TLS cannot be enabled, the LDAP * connection will fail. */ -/* #define USE_LDAP_TLS */ -+#define USE_LDAP_TLS ++#define USE_LDAP_TLS */ + + /* + * If you have to edit anything below this line, it's a bug. Report it diff --git a/ftp/proftpd/files/patch-contrib::mod_sql_mysql.c b/ftp/proftpd/files/patch-contrib::mod_sql_mysql.c index 9da89767a223..2f495ff0b86a 100644 --- a/ftp/proftpd/files/patch-contrib::mod_sql_mysql.c +++ b/ftp/proftpd/files/patch-contrib::mod_sql_mysql.c @@ -1,11 +1,11 @@ ---- contrib/mod_sql_mysql.c.orig Sun Nov 2 00:30:13 2003 -+++ contrib/mod_sql_mysql.c Sun Nov 2 00:30:23 2003 -@@ -134,7 +134,7 @@ - - #define _MYSQL_PORT "3306" - --#include -+#include +--- contrib/mod_sql_mysql.c.orig Tue Dec 12 19:52:15 2006 ++++ contrib/mod_sql_mysql.c Tue Dec 12 20:02:56 2006 +@@ -135,7 +135,7 @@ #include "conf.h" #include "../contrib/mod_sql.h" +-#include ++#include + + /* + * timer-handling code adds the need for a couple of forward declarations diff --git a/ftp/proftpd/files/patch-main.c b/ftp/proftpd/files/patch-main.c deleted file mode 100644 index eb948cc779aa..000000000000 --- a/ftp/proftpd/files/patch-main.c +++ /dev/null @@ -1,46 +0,0 @@ ---- src/main.c.orig Wed Mar 15 19:41:01 2006 -+++ src/main.c Wed Nov 15 19:06:18 2006 -@@ -116,6 +116,8 @@ - - static char sbuf[PR_TUNABLE_BUFFER_SIZE] = {'\0'}; - -+#define PR_DEFAULT_CMD_BUFSZ 512 -+ - static char **Argv = NULL; - static char *LastArgv = NULL; - static const char *PidPath = PR_PID_FILE_PATH; -@@ -820,16 +822,25 @@ - pr_timer_reset(TIMER_IDLE, NULL); - - if (cmd_buf_size == -1) { -- long *buf_size = get_param_ptr(main_server->conf, -- "CommandBufferSize", FALSE); -- -- if (buf_size == NULL || *buf_size <= 0) -- cmd_buf_size = 512; -+ int *bufsz = get_param_ptr(main_server->conf, "CommandBufferSize", -+ FALSE); - -- else if (*buf_size + 1 > sizeof(buf)) { -- pr_log_pri(PR_LOG_WARNING, "Invalid CommandBufferSize size given. " -- "Resetting to 512."); -- cmd_buf_size = 512; -+ if (bufsz == NULL || -+ *bufsz <= 0) { -+ pr_log_pri(PR_LOG_WARNING, "invalid CommandBufferSize size " -+ "given, resetting to default buffer size (%u)", -+ (unsigned int) PR_DEFAULT_CMD_BUFSZ); -+ cmd_buf_size = PR_DEFAULT_CMD_BUFSZ; -+ -+ } else if (*bufsz + 1 > sizeof(buf)) { -+ pr_log_pri(PR_LOG_WARNING, "invalid CommandBufferSize size (%d) " -+ "given, resetting to default buffer size (%u)", -+ *bufsz, (unsigned int) PR_DEFAULT_CMD_BUFSZ); -+ cmd_buf_size = PR_DEFAULT_CMD_BUFSZ; -+ -+ } else { -+ pr_log_debug(DEBUG1, "setting CommandBufferSize to %d", *bufsz); -+ cmd_buf_size = (long) *bufsz; - } - } - diff --git a/ftp/proftpd/files/patch-mod_tls.c b/ftp/proftpd/files/patch-mod_tls.c deleted file mode 100644 index 61b62a827fef..000000000000 --- a/ftp/proftpd/files/patch-mod_tls.c +++ /dev/null @@ -1,38 +0,0 @@ -diff -u -r1.100 mod_tls.c ---- contrib/mod_tls.c 29 Nov 2006 03:47:56 -0000 1.100 -+++ contrib/mod_tls.c 29 Nov 2006 04:09:06 -0000 -@@ -3103,17 +3103,25 @@ - long datalen = 0; - int ok; - -- if ((ok = X509_NAME_print_ex(mem, x509_name, 0, XN_FLAG_ONELINE))) -- datalen = BIO_get_mem_data(mem, &data); -+ ok = X509_NAME_print_ex(mem, x509_name, 0, XN_FLAG_ONELINE); -+ if (ok) { -+ datalen = BIO_get_mem_data(mem, &data); - -- if (data) { -- memset(&buf, '\0', sizeof(buf)); -- memcpy(buf, data, datalen); -- buf[datalen] = '\0'; -- buf[sizeof(buf)-1] = '\0'; -+ if (data) { -+ memset(&buf, '\0', sizeof(buf)); - -- BIO_free(mem); -- return buf; -+ if (datalen >= sizeof(buf)) { -+ datalen = sizeof(buf)-1; -+ } -+ -+ memcpy(buf, data, datalen); -+ -+ buf[datalen] = '\0'; -+ buf[sizeof(buf)-1] = '\0'; -+ -+ BIO_free(mem); -+ return buf; -+ } - } - - BIO_free(mem); diff --git a/ftp/proftpd/files/patch-support.c b/ftp/proftpd/files/patch-support.c deleted file mode 100644 index b4066f378711..000000000000 --- a/ftp/proftpd/files/patch-support.c +++ /dev/null @@ -1,79 +0,0 @@ ---- src/support.c 2005/09/28 02:06:26 1.78 -+++ src/support.c 2006/11/27 14:49:47 1.80 -@@ -27,7 +27,7 @@ - /* Various basic support routines for ProFTPD, used by all modules - * and not specific to one or another. - * -- * $Id: support.c,v 1.78 2005/09/28 02:06:26 castaglia Exp $ -+ * $Id: support.c,v 1.80 2006/11/27 14:49:47 jwm Exp $ - */ - - #include "conf.h" -@@ -632,7 +632,8 @@ - char **mptr,**rptr; - char *marr[33],*rarr[33]; - char buf[PR_TUNABLE_PATH_MAX] = {'\0'}, *pbuf = NULL; -- size_t mlen = 0, rlen = 0, blen; -+ size_t mlen = 0, rlen = 0; -+ int blen; - int dyn = TRUE; - - cp = buf; -@@ -646,7 +647,7 @@ - - while ((m = va_arg(args, char *)) != NULL && mlen < sizeof(marr)-1) { - char *tmp = NULL; -- size_t count = 0; -+ int count = 0; - - if ((r = va_arg(args, char *)) == NULL) - break; -@@ -659,6 +660,12 @@ - while (tmp) { - pr_signals_handle(); - count++; -+ if (count < 0) { -+ /* Integer overflow. In order to overflow integer range with a count -+ * of escapes, somebody must be doing something very strange. -+ */ -+ return s; -+ } - - /* Be sure to increment the pointer returned by strstr(3), to - * advance past the beginning of the substring for which we are -@@ -674,6 +681,12 @@ - */ - if (count) { - blen += count * (strlen(r) - strlen(m)); -+ if (blen < 0) { -+ /* Integer overflow. In order to overflow this, somebody must be -+ * doing something very strange. -+ */ -+ return s; -+ } - marr[mlen] = m; - rarr[mlen++] = r; - } -@@ -722,10 +735,11 @@ - } - - if (!*mptr) { -- if ((cp - pbuf + 1) > blen) { -+ if ((cp - pbuf + 1) >= blen) { - pr_log_pri(PR_LOG_ERR, - "WARNING: attempt to overflow internal ProFTPD buffers"); - cp = pbuf + blen - 1; -+ goto done; - } - *cp++ = *src++; - } -@@ -768,6 +782,9 @@ - char *sstrcat(char *dest, const char *src, size_t n) { - register char *d; - -+ if (n == 0) -+ return NULL; -+ - for (d = dest; *d && n > 1; d++, n--) ; - - while (n-- > 1 && *src) diff --git a/ftp/proftpd/files/patch-utf8.c b/ftp/proftpd/files/patch-utf8.c new file mode 100644 index 000000000000..f8328dadc380 --- /dev/null +++ b/ftp/proftpd/files/patch-utf8.c @@ -0,0 +1,110 @@ +--- src/utf8.c.orig Wed Jun 14 15:33:19 2006 ++++ src/utf8.c Wed Dec 13 08:40:35 2006 +@@ -23,7 +23,7 @@ + */ + + /* UTF8 encoding/decoding +- * $Id: utf8.c,v 1.3 2006/06/14 23:33:19 castaglia Exp $ ++ * $Id: utf8.c,v 1.4 2006/12/13 17:40:35 castaglia Exp $ + */ + + #include "conf.h" +@@ -38,12 +38,13 @@ + # include + #endif + ++#ifdef HAVE_ICONV_H + static iconv_t decode_conv = (iconv_t) -1; + static iconv_t encode_conv = (iconv_t) -1; + + static int utf8_convert(iconv_t conv, char *inbuf, size_t *inbuflen, + char *outbuf, size_t *outbuflen) { +-#ifdef HAVE_ICONV ++# ifdef HAVE_ICONV + char *start = inbuf; + + while (inbuflen > 0) { +@@ -61,14 +62,14 @@ + break; + } + return 0; +-#else ++# else + errno = ENOSYS; + return -1; +-#endif /* HAVE_ICONV */ ++# endif /* HAVE_ICONV */ + } + + int utf8_free(void) { +-#ifdef HAVE_ICONV ++# ifdef HAVE_ICONV + int res; + + /* Close the iconv handles. */ +@@ -81,10 +82,10 @@ + return -1; + + return 0; +-#else ++# else + errno = ENOSYS; + return -1; +-#endif ++# endif + } + + int utf8_init(void) { +@@ -111,7 +112,7 @@ + "conversion"); + #endif /* HAVE_NL_LANGINFO */ + +-#ifdef HAVE_ICONV ++# ifdef HAVE_ICONV + /* Get the iconv handles. */ + encode_conv = iconv_open(local_charset, "UTF-8"); + if (encode_conv == (iconv_t) -1) +@@ -122,13 +123,15 @@ + return -1; + + return 0; +-#else ++# else + errno = ENOSYS; + return -1; +-#endif /* HAVE_ICONV */ ++# endif /* HAVE_ICONV */ + } ++#endif /* !HAVE_ICONV_H */ + + char *pr_utf8_decode(pool *p, const char *in, size_t inlen, size_t *outlen) { ++#ifdef HAVE_ICONV_H + size_t inbuflen, outbuflen; + char *inbuf, outbuf[PR_TUNABLE_PATH_MAX*2], *res = NULL; + +@@ -156,9 +159,14 @@ + memcpy(res, outbuf, *outlen); + + return res; ++#else ++ pr_trace_msg("utf8", 1, "missing iconv support, no UTF8 decoding possible"); ++ return pstrdup(p, in); ++#endif /* !HAVE_ICONV_H */ + } + + char *pr_utf8_encode(pool *p, const char *in, size_t inlen, size_t *outlen) { ++#ifdef HAVE_ICONV_H + size_t inbuflen, outbuflen; + char *inbuf, outbuf[PR_TUNABLE_PATH_MAX*2], *res; + +@@ -186,6 +194,10 @@ + memcpy(res, outbuf, *outlen); + + return res; ++#else ++ pr_trace_msg("utf8", 1, "missing iconv support, no UTF8 encoding possible"); ++ return pstrdup(p, in); ++#endif /* !HAVE_ICONV_H */ + } + + #endif /* PR_USE_NLS */ diff --git a/ftp/proftpd/pkg-plist b/ftp/proftpd/pkg-plist index 61c08dc01ad8..b4a7328f638f 100644 --- a/ftp/proftpd/pkg-plist +++ b/ftp/proftpd/pkg-plist @@ -2,11 +2,62 @@ bin/ftpcount bin/ftpdctl bin/ftptop bin/ftpwho -@unexec if cmp -s %D/etc/proftpd.conf %D/%%EXAMPLESDIR%%/etc/proftpd.conf; then rm -f %D/etc/proftpd.conf; fi -%%EXAMPLESDIR%%/etc/proftpd.conf -@exec if [ ! -f %D/etc/proftpd.conf ] ; then cp -p %D/%F %B/proftpd.conf; fi +etc/proftpd.conf +include/proftpd/auth.h +include/proftpd/bindings.h +include/proftpd/buildstamp.h +include/proftpd/child.h +include/proftpd/class.h +include/proftpd/compat.h +include/proftpd/conf.h +include/proftpd/config.h +include/proftpd/ctrls.h +include/proftpd/data.h +include/proftpd/default_paths.h +include/proftpd/dirtree.h +include/proftpd/display.h +include/proftpd/event.h +include/proftpd/feat.h +include/proftpd/fsio.h +include/proftpd/ftp.h +include/proftpd/glibc-glob.h +include/proftpd/help.h +include/proftpd/ident.h +include/proftpd/inet.h +include/proftpd/lastlog.h +include/proftpd/libsupp.h +include/proftpd/log.h +include/proftpd/mkhome.h +include/proftpd/mod_ctrls.h +include/proftpd/mod_wrap2.h +include/proftpd/modules.h +include/proftpd/netacl.h +include/proftpd/netaddr.h +include/proftpd/netio.h +include/proftpd/options.h +include/proftpd/parser.h +include/proftpd/pool.h +include/proftpd/pr-syslog.h +include/proftpd/privs.h +include/proftpd/proftpd.h +include/proftpd/regexp.h +include/proftpd/response.h +include/proftpd/scoreboard.h +include/proftpd/sets.h +include/proftpd/support.h +include/proftpd/table.h +include/proftpd/timers.h +include/proftpd/trace.h +include/proftpd/utf8.h +include/proftpd/var.h +include/proftpd/version.h +include/proftpd/xferlog.h sbin/ftpshut sbin/in.proftpd sbin/proftpd +@unexec if cmp -s %D/etc/proftpd.conf %D/%%EXAMPLESDIR%%/etc/proftpd.conf; then rm -f %D/etc/proftpd.conf; fi +%%EXAMPLESDIR%%/etc/proftpd.conf +@exec if [ ! -f %D/etc/proftpd.conf ] ; then cp -p %D/%F %B/proftpd.conf; fi @dirrm %%EXAMPLESDIR%%/etc @dirrm %%EXAMPLESDIR%% +@dirrm include/proftpd