Hurd: account for setgroups() being callable unprivileged
[users/jgh/exim.git] / src / src / exim.c
index f0feaf5bd43eb8575113b21c177f63ae29498abe..af4b525591c6140988e9773107d24bc404656c69 100644 (file)
@@ -1114,6 +1114,9 @@ show_db_version(fp);
 #ifdef SUPPORT_I18N
   utf8_version_report(fp);
 #endif
+#ifdef SUPPORT_SPF
+  spf_lib_version_report(fp);
+#endif
 
   for (auth_info * authi = auths_available; *authi->driver_name != '\0'; ++authi)
     if (authi->version_report)
@@ -3638,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
@@ -4293,8 +4296,8 @@ else
     if (!(unprivileged || removed_privilege))
       exim_fail("exim: changing group failed: %s\n", strerror(errno));
     else
-      DEBUG(D_any) debug_printf("changing group to %ld failed: %d: %s\n",
-          (long int)exim_gid, errno, strerror(errno));
+      DEBUG(D_any) debug_printf("changing group to %ld failed: %s\n",
+          (long int)exim_gid, strerror(errno));
   }
 
 /* Handle a request to scan a file for malware */