[dovecot-cvs] dovecot/src/master mail-process.c,1.96.2.6,1.96.2.7

cras at dovecot.org cras at dovecot.org
Fri Aug 11 04:12:07 EEST 2006


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv1515

Modified Files:
      Tag: branch_1_0
	mail-process.c 
Log Message:
Check log_creaate_pipe() and dup() return values and handle failures.



Index: mail-process.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/mail-process.c,v
retrieving revision 1.96.2.6
retrieving revision 1.96.2.7
diff -u -d -r1.96.2.6 -r1.96.2.7
--- mail-process.c	6 Aug 2006 20:37:14 -0000	1.96.2.6
+++ mail-process.c	11 Aug 2006 01:12:04 -0000	1.96.2.7
@@ -474,11 +474,17 @@
 		}
 	}
 
-	if (!dump_capability)
+	if (!dump_capability) {
 		log_fd = log_create_pipe(&log, 10);
-	else {
+		if (log_fd == -1)
+			return FALSE;
+	} else {
 		log = NULL;
 		log_fd = dup(STDERR_FILENO);
+		if (log_fd == -1) {
+			i_error("dup() failed: %m");
+			return FALSE;
+		}
 		fd_close_on_exec(log_fd, TRUE);
 	}
 



More information about the dovecot-cvs mailing list