Expand uidlists and gidlists (admin_groups, never_users, trusted_users,
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Mon, 19 Sep 2005 14:01:51 +0000 (14:01 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Mon, 19 Sep 2005 14:01:51 +0000 (14:01 +0000)
trusted_groups).

doc/doc-txt/ChangeLog
doc/doc-txt/NewStuff
src/ACKNOWLEDGMENTS
src/src/readconf.c

index c3d1fe70aca1026e7c868c4897c62c19224ab004..1d047283d95e314418c1f1eb87cd52d5b381ee68 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.236 2005/09/19 11:56:11 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.237 2005/09/19 14:01:51 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -210,6 +210,8 @@ TF/06 The fix for widen_domains has also been applied to qualify_single and
 PH/49 Michael Haardt's randomized retrying, but as a separate retry parameter
       type ("H").
 
 PH/49 Michael Haardt's randomized retrying, but as a separate retry parameter
       type ("H").
 
+PH/50 Make never_users, trusted_users, admin_groups, trusted_groups expandable.
+
 
 Exim version 4.52
 -----------------
 
 Exim version 4.52
 -----------------
index 4640547aed7311d0b86c598243c59554af80ad6e..87e364df6461ca4f424cd3fa72c88f152418f1c9 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.72 2005/09/19 11:56:11 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.73 2005/09/19 14:01:51 ph10 Exp $
 
 New Features in Exim
 --------------------
 
 New Features in Exim
 --------------------
@@ -165,6 +165,9 @@ PH/13 A new letter, "H", is available in retry parameter sets. It is similar
       cluster restart at once, and may synchronize their queue processing
       times.
 
       cluster restart at once, and may synchronize their queue processing
       times.
 
+PH/14 The options never_users, trusted_users, admin_groups, and trusted_groups
+      are now expanded when the configuration file is read.
+
 
 Exim version 4.52
 -----------------
 
 Exim version 4.52
 -----------------
index 9b60b6f30f077ae7f1ffea198ace89563d62e7e2..abaa254b33ba0e8e462c048616927d29a9a75495 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.35 2005/09/19 11:56:11 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.36 2005/09/19 14:01:51 ph10 Exp $
 
 EXIM ACKNOWLEDGEMENTS
 
 
 EXIM ACKNOWLEDGEMENTS
 
@@ -208,6 +208,7 @@ Alexander Sabourenkov     Patch to add saslauthd daemon support
                           Patch for MySQL non-data queries
 David Saez                Suggested patch for $sender_hostname lookup if needed
                           Support for the clamd virus scanner
                           Patch for MySQL non-data queries
 David Saez                Suggested patch for $sender_hostname lookup if needed
                           Support for the clamd virus scanner
+Jonathan Sambrook         Suggested patch for expanding uid and gid lists
 Peter Savitch             Diagnosis of FPE bug when statvfs() fails on spool
 Harald Schueler           Patch for dn_expand() failure on truncated data
 Heiko Schlichting         Diagnosis of intermittent daemon crash bug
 Peter Savitch             Diagnosis of FPE bug when statvfs() fails on spool
 Harald Schueler           Patch for dn_expand() failure on truncated data
 Heiko Schlichting         Diagnosis of intermittent daemon crash bug
index 3ceece4894e81a58ac0e2a2b3c3e6ac4c7c3411b..2a0b9d12081205160a8fd361a1c004207888fb52 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/readconf.c,v 1.13 2005/09/19 11:56:11 ph10 Exp $ */
+/* $Cambridge: exim/src/src/readconf.c,v 1.14 2005/09/19 14:01:51 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -1625,10 +1625,16 @@ switch (type)
       int count = 1;
       uid_t *list;
       int ptr = 0;
       int count = 1;
       uid_t *list;
       int ptr = 0;
-      uschar *p = sptr;
+      uschar *p;
+      uschar *op = expand_string (sptr);
+
+      if (op == NULL)
+        log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "failed to expand %s: %s",
+          name, expand_string_message);
 
 
+      p = op;
       if (*p != 0) count++;
       if (*p != 0) count++;
-      while (*p != 0) if (*p++ == ':') count++;
+      while (*p != 0) if (*p++ == ':' && *p != 0) count++;
       list = store_malloc(count*sizeof(uid_t));
       list[ptr++] = (uid_t)(count - 1);
 
       list = store_malloc(count*sizeof(uid_t));
       list[ptr++] = (uid_t)(count - 1);
 
@@ -1637,7 +1643,7 @@ switch (type)
       else
         *((uid_t **)((uschar *)data_block + (long int)(ol->value))) = list;
 
       else
         *((uid_t **)((uschar *)data_block + (long int)(ol->value))) = list;
 
-      p = sptr;
+      p = op;
       while (count-- > 1)
         {
         int sep = 0;
       while (count-- > 1)
         {
         int sep = 0;
@@ -1660,10 +1666,16 @@ switch (type)
       int count = 1;
       gid_t *list;
       int ptr = 0;
       int count = 1;
       gid_t *list;
       int ptr = 0;
-      uschar *p = sptr;
+      uschar *p;
+      uschar *op = expand_string (sptr);
+
+      if (op == NULL)
+        log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, "failed to expand %s: %s",
+          name, expand_string_message);
 
 
+      p = op;
       if (*p != 0) count++;
       if (*p != 0) count++;
-      while (*p != 0) if (*p++ == ':') count++;
+      while (*p != 0) if (*p++ == ':' && *p != 0) count++;
       list = store_malloc(count*sizeof(gid_t));
       list[ptr++] = (gid_t)(count - 1);
 
       list = store_malloc(count*sizeof(gid_t));
       list[ptr++] = (gid_t)(count - 1);
 
@@ -1672,7 +1684,7 @@ switch (type)
       else
         *((gid_t **)((uschar *)data_block + (long int)(ol->value))) = list;
 
       else
         *((gid_t **)((uschar *)data_block + (long int)(ol->value))) = list;
 
-      p = sptr;
+      p = op;
       while (count-- > 1)
         {
         int sep = 0;
       while (count-- > 1)
         {
         int sep = 0;