changeset 3633:1e053e5e160d HEAD

If user's home directory is a non-directory (eg. /dev/null) fallback to /tmp without error message.
author Timo Sirainen <tss@iki.fi>
date Sat, 01 Oct 2005 12:48:11 +0300
parents 277906fcc8ea
children 377f69be914f
files src/master/mail-process.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/mail-process.c	Sat Oct 01 12:47:17 2005 +0300
+++ b/src/master/mail-process.c	Sat Oct 01 12:48:11 2005 +0300
@@ -456,8 +456,10 @@
 
 		/* If user's home directory doesn't exist and we're not
 		   trying to chroot anywhere, fallback to /tmp as the mails
-		   could be stored elsewhere. */
-		if (ret < 0 && (errno != ENOENT || *chroot_dir != '\0')) {
+		   could be stored elsewhere. The ENOTDIR check is mostly for
+		   /dev/null home directory. */
+		if (ret < 0 && ((errno != ENOENT && errno != ENOTDIR) ||
+				*chroot_dir != '\0')) {
 			i_fatal("chdir(%s) failed with uid %s: %m",
 				full_home_dir, dec2str(uid));
 		}