diff src/master/mail-process.c @ 9217:dd49cf3fd2c9 HEAD

imap/pop3 logins now fail if home directory path is relative.
author Timo Sirainen <tss@iki.fi>
date Thu, 09 Jul 2009 19:15:59 -0400
parents 23f676bada8c
children 25650d7f6b85
line wrap: on
line diff
--- a/src/master/mail-process.c	Thu Jul 09 13:28:47 2009 -0400
+++ b/src/master/mail-process.c	Thu Jul 09 19:15:59 2009 -0400
@@ -605,6 +605,12 @@
 	for (; *args != NULL; args++) {
 		if (strncmp(*args, "home=", 5) == 0) {
 			home_dir = *args + 5;
+			if (*home_dir != '/') {
+				i_error("Relative home directory paths not "
+					"supported (user %s): %s",
+					user, home_dir);
+				return MASTER_LOGIN_STATUS_INTERNAL_ERROR;
+			}
 			home_given = TRUE;
 		} else if (strncmp(*args, "mail=", 5) == 0)
 			mail = *args + 5;
@@ -670,10 +676,6 @@
 		   a possibility of using them (non-empty valid_chroot_dirs)*/
 		chroot_dir = t_strdup_until(home_dir, p);
 		home_dir = p + 2;
-	} else if (*chroot_dir != '\0' && *home_dir != '/') {
-		/* home directories should never be relative, but force this
-		   with chroots. */
-		home_dir = t_strconcat("/", home_dir, NULL);
 	}
 
 	if (!dump_capability) {