Call initgroups() when dropping privilege, in order that Exim runs with
[exim.git] / src / src / exim.c
index 30ea05c41eb07e0ddb559b02491e7225a5d96b24..41016ad3e3b5c849681eb7e9b6e5e86b90d855d1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/exim.c,v 1.37 2006/03/09 15:10:16 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.39 2006/05/22 18:42:34 fanf2 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -874,8 +874,8 @@ fprintf(f, "Support for:");
 #if HAVE_IPV6
   fprintf(f, " IPv6");
 #endif
-#ifdef HAVE_LOGIN_CAP
-  fprintf(f, " use_classresources");
+#ifdef HAVE_SETCLASSRESOURCES
+  fprintf(f, " use_setclassresources");
 #endif
 #ifdef SUPPORT_PAM
   fprintf(f, " PAM");
@@ -3597,7 +3597,9 @@ root privilege above as a result of -C, -D, -be, -bf or -bF, remove it now
 except when starting the daemon or doing some kind of delivery or address
 testing (-bt). These are the only cases when root need to be retained. We run
 as exim for -bv and -bh. However, if deliver_drop_privilege is set, root is
-retained only for starting the daemon. */
+retained only for starting the daemon. We always do the initgroups() in this
+situation (controlled by the TRUE below), in order to be as close as possible
+to the state Exim usually runs in. */
 
 if (!unprivileged &&                      /* originally had root AND */
     !removed_privilege &&                 /* still got root AND      */
@@ -3613,7 +3615,7 @@ if (!unprivileged &&                      /* originally had root AND */
         )
       ))
   {
-  exim_setugid(exim_uid, exim_gid, FALSE, US"privilege not needed");
+  exim_setugid(exim_uid, exim_gid, TRUE, US"privilege not needed");
   }
 
 /* When we are retaining a privileged uid, we still change to the exim gid. */