]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Use relative path for stats_writer_socket_path for chrooted services
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 30 Sep 2021 22:44:35 +0000 (01:44 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 7 Oct 2021 06:11:20 +0000 (06:11 +0000)
This allows login process to reconnect to stats-writer if it gets
disconnected.

src/master/service-process.c

index 29f2f813623e63ae53180557ab9c8af651616cd5..34d23ff55d41edb4b4ffbbb1261ed8a42fbf7da8 100644 (file)
@@ -263,7 +263,14 @@ service_process_setup_environment(struct service *service, unsigned int uid,
        if (!service->set->master_set->version_ignore)
                env_put(MASTER_DOVECOT_VERSION_ENV, PACKAGE_VERSION);
 
-       if (service_set->stats_writer_socket_path[0] != '\0') {
+       if (service_set->stats_writer_socket_path[0] == '\0')
+               ; /* stats-writer socket disabled */
+       else if (service->set->chroot[0] != '\0') {
+               /* In a chroot - expect stats-writer socket to be in the
+                  current directory. */
+               env_put(DOVECOT_STATS_WRITER_SOCKET_PATH,
+                       service_set->stats_writer_socket_path);
+       } else {
                env_put(DOVECOT_STATS_WRITER_SOCKET_PATH,
                        t_strdup_printf("%s/%s", service_set->base_dir,
                                        service_set->stats_writer_socket_path));