[exim-cvs] Hurd: account for setgroups() being callable unpr…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Hurd: account for setgroups() being callable unprivileged
Gitweb: https://git.exim.org/exim.git/commitdiff/ccbb15c9d7d7cac10228311aa1c7e448343a345d
Commit:     ccbb15c9d7d7cac10228311aa1c7e448343a345d
Parent:     53ef3d8498e76615b531f2f61604334e9884ba03
Author:     Samuel Thibault <samuel.thibault@???>
AuthorDate: Mon Jan 6 13:46:54 2020 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Jan 6 14:33:10 2020 +0000


    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 3fda222..af4b525 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