Re: [Exim] ACL problem when reading ACLs from files

Pàgina inicial
Delete this message
Reply to this message
Autor: William Thompson
Data:  
A: Philip Hazel
CC: Giuliano Gavazzi, exim-users
Assumpte: Re: [Exim] ACL problem when reading ACLs from files
> > I'm trying to think how to go about a modification.
>
> Ah, the benefit of Open Source. :-)


Fixed it... =)

If it's unacceptable, please let me know. The way I did it works, there's
just duplicated code.

Here it is:
--- acl.c-orig    Mon May 12 09:39:17 2003
+++ acl.c    Tue May 20 10:37:27 2003
@@ -1274,13 +1274,35 @@
 acl_getline(void)
 {
 uschar *yield;
+uschar *cont;
 do
   {
   while (isspace(*acl_text)) acl_text++;
   if (*acl_text == 0) return NULL;
   yield = acl_text;
+  continuation_line:
   while (*acl_text != 0 && *acl_text != '\n') acl_text++;
-  if (*acl_text == '\n') *acl_text++ = 0;
+  if (*acl_text == '\n')
+    {
+    if (acl_text[-1] == '\\')
+      {
+      cont = acl_text++ - 1;
+      while (isspace(*acl_text)) acl_text++;
+      while (*acl_text == '#')
+        {
+        while (*acl_text != 0 && *acl_text != '\n') acl_text++;
+        if (*acl_text == '\n') acl_text++;
+        while (isspace(*acl_text)) acl_text++;
+        }
+      memmove(cont, acl_text, Ustrlen(acl_text) + 1);
+      acl_text = cont;
+      goto continuation_line;
+      }
+    else
+      {
+      *acl_text++ = 0;
+      }
+    }
   }
 while (*yield == '#');
 return yield;