aboutsummaryrefslogtreecommitdiff
path: root/ftp/proftpd
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2011-12-29 20:58:59 +0000
committerMartin Matuska <mm@FreeBSD.org>2011-12-29 20:58:59 +0000
commit9f1f5342d274426e316a921d5672cc5aa9381627 (patch)
tree5bbb4bd55f64e3202cb732ba800530cfd4882b48 /ftp/proftpd
parent9a2e1189a38123cdf0dea7a18bb68e61a6dec22f (diff)
downloadports-9f1f5342d274426e316a921d5672cc5aa9381627.tar.gz
ports-9f1f5342d274426e316a921d5672cc5aa9381627.zip
Notes
Diffstat (limited to 'ftp/proftpd')
-rw-r--r--ftp/proftpd/Makefile7
-rw-r--r--ftp/proftpd/files/patch-src-fsio.c41
2 files changed, 39 insertions, 9 deletions
diff --git a/ftp/proftpd/Makefile b/ftp/proftpd/Makefile
index 4e2c0d081003..78d533cc9782 100644
--- a/ftp/proftpd/Makefile
+++ b/ftp/proftpd/Makefile
@@ -7,7 +7,7 @@
PORTNAME= proftpd
PORTVERSION= 1.3.3g
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES?= ftp
MASTER_SITES= ftp://ftp.proftpd.org/distrib/source/ \
ftp://ftp.fastorama.com/mirrors/ftp.proftpd.org/distrib/source/ \
@@ -55,6 +55,7 @@ CONFIGURE_ARGS= --localstatedir=${LOCALSTATEDIR} \
OPTIONS= BAN "Include mod_ban (Requires CTRLS)" off \
CLAMAV "Include mod_clamav" off \
CTRLS "Include controls" off \
+ DYNMASQ "Include mod_dynmasq" off \
EXEC "Include mod_exec" off \
HTMLDOCS "Include HTML documentation" off \
IFSESSION "Include mod_ifsession" on \
@@ -143,6 +144,10 @@ LIBDIRS:=${LIBDIRS}:${LOCALBASE}/lib
MODULES:=${MODULES}:mod_wrap2_sql
.endif
+.if defined(WITH_DYNMASQ)
+MODULES:=${MODULES}:mod_dynmasq
+.endif
+
.if defined(WITH_EXEC)
MODULES:=${MODULES}:mod_exec
.endif
diff --git a/ftp/proftpd/files/patch-src-fsio.c b/ftp/proftpd/files/patch-src-fsio.c
index 22e66f6f7ab2..3b085be7283c 100644
--- a/ftp/proftpd/files/patch-src-fsio.c
+++ b/ftp/proftpd/files/patch-src-fsio.c
@@ -1,19 +1,44 @@
---- src/fsio.c.orig 2010-04-12 12:00:00.000000000 -0700
-+++ src/fsio.c 2011-12-16 15:12:07.799166185 -0800
-@@ -50,6 +50,8 @@
+--- src/fsio.c.orig 2010-04-12 21:00:00.000000000 +0200
++++ src/fsio.c 2011-12-29 21:51:33.844925577 +0100
+@@ -50,6 +50,10 @@
# include <acl/libacl.h>
#endif
-+#include <unistd.h>
++#if defined(__FreeBSD__)
++#include <dlfcn.h>
++#endif
+
typedef struct fsopendir fsopendir_t;
struct fsopendir {
-@@ -287,6 +289,7 @@
+@@ -284,7 +288,30 @@
+ #endif
+ }
+
++#if defined(__FreeBSD__)
++static int
++enter_freebsd_restricted_mode()
++{
++ typedef void frmode_t();
++ frmode_t *frmode;
++
++ frmode = (frmode_t *)dlfunc(
++ RTLD_NEXT, "__FreeBSD_libc_enter_restricted_mode");
++ if (frmode == NULL) {
++ pr_log_pri(PR_LOG_ERR,
++ "error: FreeBSD with vulnerable chroot (FreeBSD-SA-11:07.chroot)");
++ return 1;
++ }
++ frmode();
++ return 0;
++}
++#endif
++
static int sys_chroot(pr_fs_t *fs, const char *path) {
++#if defined(__FreeBSD__)
++ if (enter_freebsd_restricted_mode() != 0)
++ return -1;
++#endif
if (chroot(path) < 0)
return -1;
-+ __FreeBSD_libc_enter_restricted_mode();
- session.chroot_path = (char *) path;
- return 0;