Don't ignore group on a router when the transport has no user/group
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Mon, 12 Dec 2005 11:41:50 +0000 (11:41 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Mon, 12 Dec 2005 11:41:50 +0000 (11:41 +0000)
setting.

doc/doc-txt/ChangeLog
src/src/deliver.c

index e38a7f95edfe72ea7958019f550127fbd92f359f..83b4de2d71d0bbc4d7381d08b7c58f93718824eb 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.272 2005/12/12 11:02:44 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.273 2005/12/12 11:41:50 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -26,6 +26,9 @@ PH/04 Changed $reply_address to use the raw form of the headers instead of the
       newlines turned into spaces so that the autoreply transport does not
       grumble.
 
       newlines turned into spaces so that the autoreply transport does not
       grumble.
 
+PH/05 If group was specified without a user on a router, and no group or user
+      was specified on a transport, the group from the router was ignored.
+
 
 Exim version 4.60
 -----------------
 
 Exim version 4.60
 -----------------
index 83a3d1ad4e48ccdacd9ab96eeb02bd0dfc12f5d2..655ec9b8e7c76a367dc955a26783756a072015cb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/deliver.c,v 1.23 2005/11/14 13:56:49 ph10 Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.24 2005/12/12 11:41:50 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -1304,6 +1304,14 @@ else if (tp->expand_gid != NULL)
     }
   }
 
     }
   }
 
+/* If the transport did not set a group, see if the router did. */
+
+if (!gid_set && testflag(addr, af_gid_set))
+  {
+  *gidp = addr->gid;
+  gid_set = TRUE;
+  }
+
 /* Pick up a uid from the transport if one is set. */
 
 if (tp->uid_set) *uidp = tp->uid;
 /* Pick up a uid from the transport if one is set. */
 
 if (tp->uid_set) *uidp = tp->uid;
@@ -1339,20 +1347,13 @@ else if (tp->deliver_as_creator)
     }
   }
 
     }
   }
 
-/* Otherwise see if the address specifies the uid and if so, take its
-initgroups flag. The gid from the address is taken only if the transport hasn't
-set it. In other words, a gid on the transport overrides the gid on the
-address. */
+/* Otherwise see if the address specifies the uid and if so, take it and its
+initgroups flag. */
 
 else if (testflag(addr, af_uid_set))
   {
   *uidp = addr->uid;
   *igfp = testflag(addr, af_initgroups);
 
 else if (testflag(addr, af_uid_set))
   {
   *uidp = addr->uid;
   *igfp = testflag(addr, af_initgroups);
-  if (!gid_set)
-    {
-    *gidp = addr->gid;
-    gid_set = TRUE;
-    }
   }
 
 /* Nothing has specified the uid - default to the Exim user, and group if the
   }
 
 /* Nothing has specified the uid - default to the Exim user, and group if the
@@ -1368,7 +1369,9 @@ else
     }
   }
 
     }
   }
 
-/* If no gid is set, it is a disaster. */
+/* If no gid is set, it is a disaster. We default to the Exim gid only if
+defaulting to the Exim uid. In other words, if the configuration has specified
+a uid, it must also provide a gid. */
 
 if (!gid_set)
   {
 
 if (!gid_set)
   {