]> 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>
Mon, 3 Apr 2017 11:00:04 +0000 (14:00 +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 9a8e034a7f84c95e53d2fa17a14dda704a280452..7ca127ec29bfbdf7223f55077876be997fe7d20e 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);
 }