[dovecot-cvs] dovecot/src/deliver deliver.c,1.20.2.19,1.20.2.20

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


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

Modified Files:
      Tag: branch_1_0
	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.20.2.19
retrieving revision 1.20.2.20
diff -u -d -r1.20.2.19 -r1.20.2.20
--- deliver.c	5 Nov 2006 20:47:14 -0000	1.20.2.19
+++ deliver.c	12 Nov 2006 21:31:48 -0000	1.20.2.20
@@ -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