From ccbb15c9d7d7cac10228311aa1c7e448343a345d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 6 Jan 2020 13:46:54 +0000 Subject: [PATCH] Hurd: account for setgroups() being callable unprivileged --- src/src/exim.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/src/exim.c b/src/src/exim.c index 3fda22232..af4b52559 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -3641,15 +3641,15 @@ an error return. The following code should cope with both types of system. in the call to exim_setugid(). However, if this process isn't running as root, setgroups() can't be used -since you have to be root to run it, even if throwing away groups. Not being -root here happens only in some unusual configurations. We just ignore the -error. */ +since you have to be root to run it, even if throwing away groups. +Except, sigh, for Hurd - where you can. +Not being root here happens only in some unusual configurations. */ -if ( +if ( !unprivileged #ifndef OS_SETGROUPS_ZERO_DROPS_ALL - setgroups(0, NULL) != 0 && + && setgroups(0, NULL) != 0 #endif - setgroups(1, group_list) != 0 && !unprivileged) + && setgroups(1, group_list) != 0) exim_fail("exim: setgroups() failed: %s\n", strerror(errno)); /* If the configuration file name has been altered by an argument on the -- 2.30.2