dovecot-2.0: doveadm: Preserve $HOME when execing doveconf.

dovecot at dovecot.org dovecot at dovecot.org
Thu May 27 22:55:49 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/34621611fb33
changeset: 11400:34621611fb33
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 27 20:55:45 2010 +0100
description:
doveadm: Preserve $HOME when execing doveconf.

diffstat:

 src/doveadm/doveadm.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r ca0503623ff2 -r 34621611fb33 src/doveadm/doveadm.c
--- a/src/doveadm/doveadm.c	Thu May 27 20:49:00 2010 +0100
+++ b/src/doveadm/doveadm.c	Thu May 27 20:55:45 2010 +0100
@@ -188,13 +188,15 @@
 
 int main(int argc, char *argv[])
 {
-	const struct setting_parser_info *set_roots[] = {
+	static const struct setting_parser_info *set_roots[] = {
 		&doveadm_setting_parser_info,
 		NULL
 	};
 	enum master_service_flags service_flags =
 		MASTER_SERVICE_FLAG_STANDALONE |
 		MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN;
+	struct master_service_settings_input input;
+	struct master_service_settings_output output;
 	const char *cmd_name, *error;
 	unsigned int i;
 	int c;
@@ -217,8 +219,12 @@
 		}
 	}
 
-	if (master_service_settings_read_simple(master_service, set_roots,
-						&error) < 0)
+	memset(&input, 0, sizeof(input));
+	input.roots = set_roots;
+	input.module = "doveadm";
+	input.preserve_home = TRUE;
+	if (master_service_settings_read(master_service, &input,
+					 &output, &error) < 0)
 		i_fatal("Error reading configuration: %s", error);
 	doveadm_settings = master_service_settings_get_others(master_service)[0];
 


More information about the dovecot-cvs mailing list