Skip to content

Commit

Permalink
lmtp: Always read settings before dropping privs
Browse files Browse the repository at this point in the history
If lmtp is ran explicitly as root, settings were not read.
  • Loading branch information
cmouse committed Sep 8, 2016
1 parent 82b3d02 commit a480462
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/lmtp/main.c
Expand Up @@ -42,17 +42,15 @@ static void drop_privileges(void)

/* by default we don't drop any privileges, but keep running as root. */
restrict_access_get_env(&set);
if (set.uid != 0) {
/* open config connection before dropping privileges */
struct master_service_settings_input input;
struct master_service_settings_output output;

memset(&input, 0, sizeof(input));
input.module = "lmtp";
input.service = "lmtp";
(void)master_service_settings_read(master_service,
&input, &output, &error);
}
/* open config connection before dropping privileges */
struct master_service_settings_input input;
struct master_service_settings_output output;

memset(&input, 0, sizeof(input));
input.module = "lmtp";
input.service = "lmtp";
(void)master_service_settings_read(master_service,
&input, &output, &error);
restrict_access_by_env(NULL, FALSE);
}

Expand Down

0 comments on commit a480462

Please sign in to comment.