]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Fail if SOCKET_COUNT environment is empty in non-standalone mode
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 7 Feb 2023 20:36:32 +0000 (22:36 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 9 Feb 2023 07:29:43 +0000 (07:29 +0000)
The master process is expected to always set SOCKET_COUNT.

src/lib-master/master-service.c

index 45e17aae8e4923d2e9a52695cb00e6f8d5dabe80..308b56ffc631b41a8bf44333a1763d0a58d0af10 100644 (file)
@@ -527,10 +527,9 @@ 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)
+               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);