OSSP CVS Repository

ossp - Check-in [333]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 333
Date: 2001-Jan-19 17:46:25 (local)
2001-Jan-19 16:46:25 (UTC)
User:simons
Branch:
Comment: Changed ACL semantics: The ACL is processed only if the posting didn't have a valid password. If it did, the mail is going through in any case and the ACL is not tested.
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/hermes.c      1.15 -> 1.16     26 inserted, 16 deleted

ossp-pkg/petidomo/hermes.c 1.15 -> 1.16

--- hermes.c     2001/01/19 16:02:22     1.15
+++ hermes.c     2001/01/19 16:46:25     1.16
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $
-   $Revision: 1.15 $
+   $Revision: 1.16 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -92,27 +92,37 @@
     if (FindBodyPassword(MailStruct) != 0)
         exit(1);
 
-    if (checkACL(MailStruct, listname, &operation, &parameter) != 0)
-        {
-        syslog(LOG_ERR, "checkACL() failed with an error.");
-        exit(1);
-        }
-    rc = handleACL(MailStruct, listname, operation, parameter);
-    switch(rc)
+    if (isValidPostingPassword(MailStruct->Approve, listname) == FALSE)
         {
-        case -1:
-            syslog(LOG_ERR, "handleACL() failed with an error.");
+        /* If no valid posting password has been provided, the mail is
+           subject to the ACL mechanism. Please note that the ACL may
+           actually set a correct posting password via the 'approve'
+           command. So just because there wasn't a valid posting
+           password here, it doesn't mean there might not be after ACL
+           processing is over. That's why we check the posting
+           password again below. */
+
+        if (checkACL(MailStruct, listname, &operation, &parameter) != 0)
+            {
+            syslog(LOG_ERR, "checkACL() failed with an error.");
             exit(1);
-        case 0:
-            break;
-        case 1:
-            return 0;
+            }
+        rc = handleACL(MailStruct, listname, operation, parameter);
+        switch(rc)
+            {
+            case -1:
+                syslog(LOG_ERR, "handleACL() failed with an error.");
+                exit(1);
+            case 0:
+                break;
+            case 1:
+                return 0;
+            }
         }
 
     if (isValidPostingPassword(MailStruct->Approve, listname) == FALSE)
         {
-        /* No valid password found. Reject the article, if the list is
-           of type 'moderated'. */
+        /* Reject the article, if the list is of type 'moderated'. */
 
         if (ListConfig->listtype == LIST_MODERATED)
             {

CVSTrac 2.0.1