]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Die at startup if config reading fails.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 31 Mar 2017 13:42:55 +0000 (16:42 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 31 Mar 2017 13:44:39 +0000 (16:44 +0300)
Although most of the time it's not strictly required for config to be read here,
one exception is SSL server settings. If this config reading fails, the SSL
initialization just crashes. So this gives a better error message than a crash.
Also config reading really isn't supposed to fail anyway.

src/lmtp/main.c

index 232c5006aa0331d9cc8ac1abf8393927e3397456..47c8ce43331c58637ce7cb5a6aaf3b3bb823fe02 100644 (file)
@@ -50,8 +50,9 @@ static void drop_privileges(void)
        i_zero(&input);
        input.module = "lmtp";
        input.service = "lmtp";
-       (void)master_service_settings_read(master_service,
-                                          &input, &output, &error);
+       if (master_service_settings_read(master_service,
+                                        &input, &output, &error) < 0)
+               i_fatal("Error reading configuration: %s", error);
        restrict_access_by_env(NULL, FALSE);
 }