dovecot-2.2: lib-master: Earlier config file path fix broke reus...

dovecot at dovecot.org dovecot at dovecot.org
Fri Sep 12 09:55:51 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/ccc5701dae72
changeset: 17794:ccc5701dae72
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 12 12:55:12 2014 +0300
description:
lib-master: Earlier config file path fix broke reusing existing config socket lookups.

diffstat:

 src/lib-master/master-service-private.h  |   3 ++-
 src/lib-master/master-service-settings.c |   6 ++++--
 src/lib-master/master-service.c          |  10 +++++-----
 3 files changed, 11 insertions(+), 8 deletions(-)

diffs (70 lines):

diff -r 2171b0e47055 -r ccc5701dae72 src/lib-master/master-service-private.h
--- a/src/lib-master/master-service-private.h	Thu Sep 11 18:15:04 2014 +0300
+++ b/src/lib-master/master-service-private.h	Fri Sep 12 12:55:12 2014 +0300
@@ -70,9 +70,10 @@
 	unsigned int initial_status_sent:1;
 	unsigned int die_with_master:1;
 	unsigned int call_avail_overflow:1;
-	unsigned int config_path_is_default:1;
+	unsigned int config_path_changed_with_param:1;
 	unsigned int want_ssl_settings:1;
 	unsigned int ssl_ctx_initialized:1;
+	unsigned int config_path_from_master:1;
 };
 
 void master_service_io_listeners_add(struct master_service *service);
diff -r 2171b0e47055 -r ccc5701dae72 src/lib-master/master-service-settings.c
--- a/src/lib-master/master-service-settings.c	Thu Sep 11 18:15:04 2014 +0300
+++ b/src/lib-master/master-service-settings.c	Fri Sep 12 12:55:12 2014 +0300
@@ -178,14 +178,16 @@
 		master_service_get_config_path(service);
 
 	if (service->config_fd != -1 && input->config_path == NULL &&
-	    service->config_path_is_default) {
+	    !service->config_path_changed_with_param) {
 		/* use the already opened config socket */
 		fd = service->config_fd;
 		service->config_fd = -1;
 		return fd;
 	}
 
-	if (service->config_path_is_default && input->config_path == NULL) {
+	if (!service->config_path_from_master &&
+	    !service->config_path_changed_with_param &&
+	    input->config_path == NULL) {
 		/* first try to connect to the default config socket.
 		   configuration may contain secrets, so in default config
 		   this fails because the socket is 0600. it's useful for
diff -r 2171b0e47055 -r ccc5701dae72 src/lib-master/master-service.c
--- a/src/lib-master/master-service.c	Thu Sep 11 18:15:04 2014 +0300
+++ b/src/lib-master/master-service.c	Fri Sep 12 12:55:12 2014 +0300
@@ -160,10 +160,10 @@
 	service->config_fd = -1;
 
 	service->config_path = i_strdup(getenv(MASTER_CONFIG_FILE_ENV));
-	if (service->config_path == NULL) {
+	if (service->config_path == NULL)
 		service->config_path = i_strdup(DEFAULT_CONFIG_FILE_PATH);
-		service->config_path_is_default = TRUE;
-	}
+	else
+		service->config_path_from_master = TRUE;
 
 	if ((flags & MASTER_SERVICE_FLAG_STANDALONE) == 0) {
 		service->version_string = getenv(MASTER_DOVECOT_VERSION_ENV);
@@ -370,13 +370,13 @@
 	switch (opt) {
 	case 'c':
 		service->config_path = i_strdup(arg);
-		service->config_path_is_default = FALSE;
+		service->config_path_changed_with_param = TRUE;
 		break;
 	case 'i':
 		if (!get_instance_config(arg, &path))
 			i_fatal("Unknown instance name: %s", arg);
 		service->config_path = i_strdup(path);
-		service->config_path_is_default = FALSE;
+		service->config_path_changed_with_param = TRUE;
 		break;
 	case 'k':
 		service->keep_environment = TRUE;


More information about the dovecot-cvs mailing list