dovecot-2.0: dsync: Execute remote dsync binary before dropping ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 23 16:30:11 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/83f98d61bea2
changeset: 12027:83f98d61bea2
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 23 14:30:08 2010 +0100
description:
dsync: Execute remote dsync binary before dropping privileges.

diffstat:

 src/dsync/dsync.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (28 lines):

diff -r ab75eff633aa -r 83f98d61bea2 src/dsync/dsync.c
--- a/src/dsync/dsync.c	Mon Aug 23 00:26:39 2010 +0100
+++ b/src/dsync/dsync.c	Mon Aug 23 14:30:08 2010 +0100
@@ -243,16 +243,18 @@
 	if (mail_storage_service_lookup(storage_service, &input,
 					&service_user, &error) <= 0)
 		i_fatal("User lookup failed: %s", error);
+
+	if (remote_cmd_args != NULL) {
+		/* _service_lookup() may exec doveconf, so do our forking
+		   after that. but do it before _service_next() in case it
+		   drops process privileges */
+		run_cmd(remote_cmd_args, &fd_in, &fd_out);
+	}
+
 	if (mail_storage_service_next(storage_service, service_user,
 				      &mail_user) < 0)
 		i_fatal("User init failed");
 
-	if (remote_cmd_args != NULL) {
-		/* user initialization may exec doveconf, so do our forking
-		   after that */
-		run_cmd(remote_cmd_args, &fd_in, &fd_out);
-	}
-
 	/* create the first local worker */
 	worker1 = dsync_worker_init_local(mail_user, alt_char);
 	if (local_location != NULL) {


More information about the dovecot-cvs mailing list