Mercurial > dovecot > original-hg > dovecot-2.2
changeset 17765:8b5664bce4a0
lib-master: Fixed -c & -i command line parameters when config socket was readable.
The config socket was always being read, even if another config file was
attempted to be used.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 09 Sep 2014 17:09:30 +0300 |
parents | bf1faf8ab847 |
children | 992f17769cca |
files | src/lib-master/master-service-settings.c |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-master/master-service-settings.c Mon Sep 08 18:11:31 2014 +0300 +++ b/src/lib-master/master-service-settings.c Tue Sep 09 17:09:30 2014 +0300 @@ -177,7 +177,8 @@ *path_r = path = input->config_path != NULL ? input->config_path : master_service_get_config_path(service); - if (service->config_fd != -1 && input->config_path == NULL) { + if (service->config_fd != -1 && input->config_path == NULL && + service->config_path_is_default) { /* use the already opened config socket */ fd = service->config_fd; service->config_fd = -1; @@ -344,6 +345,12 @@ const char *path, *error; int fd; + /* we'll get here before command line parameters have been parsed, + so -O, -c and -i parameters haven't been handled yet at this point. + this means we could end up opening config socket connection + unnecessarily, but this isn't a problem. we'll just have to + ignore it later on. (unfortunately there isn't a master_service_*() + call where this function would be better called.) */ if (getenv("DOVECONF_ENV") != NULL || (service->flags & MASTER_SERVICE_FLAG_NO_CONFIG_SETTINGS) != 0) return;