]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Always import systemd related variables with systemd
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 23 Feb 2021 10:52:29 +0000 (12:52 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 3 Mar 2021 09:53:46 +0000 (09:53 +0000)
Otherwise it is too easy to break systemd integration by forgetting
these from import_environment.

src/lib-master/master-service.c

index 90ca40f744ee1bfcb9887711de36f750f57dd048..8e39d2e7fbf6731e1de7286a7cfe3d77e5768aef 100644 (file)
@@ -709,6 +709,12 @@ static void master_service_import_environment_real(const char *import_environmen
        value = getenv(DOVECOT_PRESERVE_ENVS_ENV);
        if (value != NULL)
                array_push_back(&keys, &value);
+#ifdef HAVE_LIBSYSTEMD
+       /* Always import systemd variables, otherwise it is possible to break
+          systemd startup in obscure ways. */
+       value = "NOTIFY_SOCKET LISTEN_FDS LISTEN_PID";
+       array_push_back(&keys, &value);
+#endif
        /* add new environments */
        envs = t_strsplit_spaces(import_environment, " ");
        for (; *envs != NULL; envs++) {