changeset 5372:56cb17817e06 HEAD

NFS check + chroots broke home directory for the first login.
author Timo Sirainen <tss@iki.fi>
date Wed, 21 Mar 2007 22:31:15 +0200
parents fdcea7e3cf0c
children ccc83c11f0e2
files src/master/mail-process.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/mail-process.c	Wed Mar 21 22:12:59 2007 +0200
+++ b/src/master/mail-process.c	Wed Mar 21 22:31:15 2007 +0200
@@ -587,9 +587,10 @@
 	if (dump_capability)
 		env_put("DUMP_CAPABILITY=1");
 
-	if (*home_dir == '\0')
+	if (*home_dir == '\0') {
+		full_home_dir = "";
 		ret = -1;
-	else {
+	} else {
 		full_home_dir = *chroot_dir == '\0' ? home_dir :
 			t_strconcat(chroot_dir, "/", home_dir, NULL);
 		/* NOTE: if home directory is NFS-mounted, we might not
@@ -648,11 +649,8 @@
 		}
 	}
 
-	if (nfs_check) {
-		if (*chroot_dir != '\0')
-			home_dir = t_strconcat(chroot_dir, "/", home_dir, NULL);
-		nfs_warn_if_found(getenv("MAIL"), chroot_dir, home_dir);
-	}
+	if (nfs_check)
+		nfs_warn_if_found(getenv("MAIL"), chroot_dir, full_home_dir);
 
 	env_put("LOGGED_IN=1");
 	env_put(t_strconcat("HOME=", home_dir, NULL));