]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Ignore SOCKET_COUNT with MASTER_SERVICE_FLAG_STANDALONE
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 7 Feb 2023 20:35:24 +0000 (22:35 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 9 Feb 2023 07:29:43 +0000 (07:29 +0000)
This could have caused problems when e.g. doveadm command was executed
inside a process started via master process.

src/lib-master/master-service.c

index 5261589a39d88bd2e00876fa04d8750cb1f38863..45e17aae8e4923d2e9a52695cb00e6f8d5dabe80 100644 (file)
@@ -528,18 +528,17 @@ master_service_init(const char *name, enum master_service_flags flags,
        if ((flags & MASTER_SERVICE_FLAG_STANDALONE) == 0) {
                service->version_string = getenv(MASTER_DOVECOT_VERSION_ENV);
                service->socket_count = 1;
+               /* listener configuration */
+               value = getenv("SOCKET_COUNT");
+               if (value != NULL && str_to_uint(value, &service->socket_count) < 0)
+                       i_fatal("Invalid SOCKET_COUNT environment");
+               T_BEGIN {
+                       master_service_init_socket_listeners(service);
+               } T_END;
        } else {
                service->version_string = PACKAGE_VERSION;
        }
 
-       /* listener configuration */
-       value = getenv("SOCKET_COUNT");
-       if (value != NULL && str_to_uint(value, &service->socket_count) < 0)
-               i_fatal("Invalid SOCKET_COUNT environment");
-       T_BEGIN {
-               master_service_init_socket_listeners(service);
-       } T_END;
-
        /* Load the SSL module if we already know it is necessary. It can also
           get loaded later on-demand. */
        if (service->want_ssl_server) {