commit ce61fee: [Minor] Allow to run without an explicit group name when `-u` is set

Vsevolod Stakhov vsevolod at rspamd.com
Sat May 13 12:35:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-05-13 13:31:23 +0100
URL: https://github.com/rspamd/rspamd/commit/ce61fee9d25cc3ff647860fe646dc3af1ba17f0d (HEAD -> master)

[Minor] Allow to run without an explicit group name when `-u` is set

---
 src/rspamd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/rspamd.c b/src/rspamd.c
index 17c6a8286..57daf2319 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -272,7 +272,8 @@ detect_priv (struct rspamd_main *rspamd_main)
 				rspamd_main->workers_gid = grp->gr_gid;
 			}
 			else {
-				rspamd_main->workers_gid = (gid_t)-1;
+				/* Use the main group of user */
+				rspamd_main->workers_gid = pwd->pw_gid;
 			}
 			rspamd_main->workers_uid = pwd->pw_uid;
 		}


More information about the Commits mailing list