Skip to content

Commit

Permalink
lmtp: Die at startup if config reading fails.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen committed Apr 3, 2017
1 parent f2ed4ef commit b73b1f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lmtp/main.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit b73b1f9

Please sign in to comment.