]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Fixed -c & -i command line parameters when config socket was readable.
authorTimo Sirainen <tss@iki.fi>
Tue, 9 Sep 2014 14:09:30 +0000 (17:09 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 9 Sep 2014 14:09:30 +0000 (17:09 +0300)
The config socket was always being read, even if another config file was
attempted to be used.

src/lib-master/master-service-settings.c

index 30ad93629af60e02caaff4e1ae23f15dff31100c..a93048fc405a710ac574d97541eb7988199f1ea0 100644 (file)
@@ -177,7 +177,8 @@ master_service_open_config(struct master_service *service,
        *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 @@ void master_service_config_socket_try_open(struct master_service *service)
        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;