[dovecot-cvs] dovecot/src/master mail-process.c,1.114,1.115

tss at dovecot.org tss at dovecot.org
Mon Feb 12 18:14:15 UTC 2007


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

Modified Files:
	mail-process.c 
Log Message:
When running dump-capability, don't do stderr_close_shutdown since it could
break and make epoll_ctl() return with EPERM.



Index: mail-process.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/mail-process.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- mail-process.c	2 Feb 2007 11:20:24 -0000	1.114
+++ mail-process.c	12 Feb 2007 18:14:13 -0000	1.115
@@ -192,7 +192,8 @@
 
 static void
 mail_process_set_environment(struct settings *set, const char *mail,
-			     const struct var_expand_table *var_expand_table)
+			     const struct var_expand_table *var_expand_table,
+			     bool dump_capability)
 {
 	const char *const *envs;
 	string_t *str;
@@ -257,7 +258,9 @@
 		env_put("MBOX_VERY_DIRTY_SYNCS=1");
 	if (set->mbox_lazy_writes)
 		env_put("MBOX_LAZY_WRITES=1");
-	if (set->shutdown_clients)
+	/* when running dump-capability log still points to stderr,
+	   and io_add()ing it might break (epoll_ctl() gives EPERM) */
+	if (set->shutdown_clients && !dump_capability)
 		env_put("STDERR_CLOSE_SHUTDOWN=1");
 	(void)umask(set->umask);
 
@@ -346,7 +349,8 @@
 				     getenv("TCPREMOTEIP"),
 				     getpid(), geteuid());
 
-	mail_process_set_environment(set, getenv("MAIL"), var_expand_table);
+	mail_process_set_environment(set, getenv("MAIL"), var_expand_table,
+				     FALSE);
         client_process_exec(executable, "");
 
 	i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", executable);
@@ -605,7 +609,8 @@
 			i_fatal("chdir(/tmp) failed: %m");
 	}
 
-        mail_process_set_environment(set, mail, var_expand_table);
+	mail_process_set_environment(set, mail, var_expand_table,
+				     dump_capability);
 
 	/* extra args. uppercase key value. */
 	args = array_get(&extra_args, &count);



More information about the dovecot-cvs mailing list