diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-20 13:14:30 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-20 13:14:30 +0000 |
commit | 11c49dc9ac730bdaa2f6b26ff877b9ba87f38572 (patch) | |
tree | 25cbd03c288de1579f620e951e2d4effe97e185c /src/libserver/worker_util.c | |
parent | cd2f92e40eca3ac7036e5cac9f90969a8d26655f (diff) | |
download | rspamd-11c49dc9ac730bdaa2f6b26ff877b9ba87f38572.tar.gz rspamd-11c49dc9ac730bdaa2f6b26ff877b9ba87f38572.zip |
[Fix] Set rspamd user to initialise supplementary groups on reload
Issue: #2693
Closes: #2693
Diffstat (limited to 'src/libserver/worker_util.c')
-rw-r--r-- | src/libserver/worker_util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index e10e25bc0..a52dd3ccb 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -513,12 +513,14 @@ rspamd_worker_drop_priv (struct rspamd_main *rspamd_main) strerror (errno)); exit (-errno); } + if (rspamd_main->cfg->rspamd_user && - initgroups (rspamd_main->cfg->rspamd_user, rspamd_main->workers_gid) == - -1) { + initgroups (rspamd_main->cfg->rspamd_user, + rspamd_main->workers_gid) == -1) { msg_err_main ("initgroups failed (%s), aborting", strerror (errno)); exit (-errno); } + if (setuid (rspamd_main->workers_uid) == -1) { msg_err_main ("cannot setuid to %d (%s), aborting", (gint) rspamd_main->workers_uid, |