aboutsummaryrefslogtreecommitdiffstats
path: root/ftp
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2011-12-30 04:58:59 +0800
committermm <mm@FreeBSD.org>2011-12-30 04:58:59 +0800
commitf7c89c06cd59e3a4c1e0485938cff188e2f6f7ee (patch)
tree8e1879a3f6cd7adb10de08b26fe9151873a21222 /ftp
parent4e4bca283ca2d32d17000fb41089500ed23bdcc5 (diff)
downloadfreebsd-ports-gnome-f7c89c06cd59e3a4c1e0485938cff188e2f6f7ee.tar.gz
freebsd-ports-gnome-f7c89c06cd59e3a4c1e0485938cff188e2f6f7ee.tar.zst
freebsd-ports-gnome-f7c89c06cd59e3a4c1e0485938cff188e2f6f7ee.zip
As of FreeBSD-SA-11:07.chroot, the port now works on both patched and
unpatched systems. On unpatched systems chroot automatically fails. FreeBSD-SA-11:07.chroot Add MOD_DYNMASQ
Diffstat (limited to 'ftp')
-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;