[dovecot-cvs] dovecot/src/deliver deliver.c,1.36,1.37

tss at dovecot.org tss at dovecot.org
Sun Nov 12 21:31:54 UTC 2006


Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv28860

Modified Files:
	deliver.c 
Log Message:
If user has a home directory, but we can't chdir() there, log an error (but
don't fail).



Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/deliver.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- deliver.c	5 Nov 2006 20:47:16 -0000	1.36
+++ deliver.c	12 Nov 2006 21:31:50 -0000	1.37
@@ -495,11 +495,12 @@
 		if (ret != 0)
 			return ret;
 
+		/* If possible chdir to home directory, so that core file
+		   could be written in case we crash. */
 		home = getenv("HOME");
 		if (home != NULL) {
-			/* If possible chdir to home directory so core file
-			   could be written. If it fails, don't worry. */
-			(void)chdir(home);
+			if (chdir(home) < 0)
+				i_error("chdir(%s) failed: %m", home);
 		}
 	} else {
 		destination = user;



More information about the dovecot-cvs mailing list