From 06dd4fb61ed86be5079d81ffa31657ba9eb90d5e Mon Sep 17 00:00:00 2001 From: Robert Minsk Date: Thu, 12 Feb 2015 12:49:19 -0800 Subject: [PATCH] If VRootServerRoot was not being used then mod_vroot was setting session.chroot to '/' --- mod_vroot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod_vroot.c b/mod_vroot.c index b0ce59a..c076f2b 100644 --- a/mod_vroot.c +++ b/mod_vroot.c @@ -868,7 +868,7 @@ static int vroot_lchown(pr_fs_t *fs, const char *path, uid_t uid, gid_t gid) { #endif /* ProFTPD 1.3.4c or later */ static int vroot_chroot(pr_fs_t *fs, const char *path) { - char *chroot_path = "/", *tmp = NULL; + char *chroot_path = vroot_base, *tmp = NULL; config_rec *c; if (!path || @@ -962,7 +962,9 @@ static int vroot_chroot(pr_fs_t *fs, const char *path) { return -1; } - session.chroot_path = pstrdup(session.pool, chroot_path); + if (chroot_path && chroot_path[0]) + session.chroot_path = pstrdup(session.pool, chroot_path); + return 0; }