OSSP CVS Repository

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

Check-in Number: 4393
Date: 2004-Feb-02 20:50:25 (local)
2004-Feb-02 19:50:25 (UTC)
User:thl
Branch:
Comment: both peti and rse did overlapping work based on (untagged) 4.0b1; peti committed to the CVS first (no version created ever); this is an attempt to manually merge rse's acl pre/post changes in (claim themselfs to lead to 4.0b2
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/acl.y      1.11 -> 1.12     16 inserted, 9 deleted
ossp-pkg/petidomo/config-files.c      1.4 -> 1.5     15 inserted, 8 deleted
ossp-pkg/petidomo/hermes.c      1.20 -> 1.21     23 inserted, 2 deleted
ossp-pkg/petidomo/listserv.c      1.8 -> 1.9     16 inserted, 2 deleted
ossp-pkg/petidomo/petidomo.h      1.20 -> 1.21     12 inserted, 4 deleted
ossp-pkg/petidomo/version.c      1.1 -> 1.2     9 inserted, 9 deleted

ossp-pkg/petidomo/acl.y 1.11 -> 1.12

--- acl.y        2001/01/20 13:42:01     1.11
+++ acl.y        2004/02/02 19:50:25     1.12
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/acl.y,v $
-   $Revision: 1.11 $
+   $Revision: 1.12 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -235,7 +235,8 @@
 int checkACL(struct Mail *   MailStruct,
              const char *    listname,
              int *           operation_ptr,
-             char **         parameter_ptr)
+             char **         parameter_ptr,
+             acl_type_t      type)
 {
     const struct PD_Config * MasterConfig;
     const struct List_Config * ListConfig;
@@ -256,15 +257,17 @@
 
     /* First check the mail against the master acl file. */
 
-    yyin = fopen(MasterConfig->acl_file, "r");
+    yyin = fopen((type == ACL_PRE ? MasterConfig->acl_file_pre : MasterConfig->acl_file_post), "r");
     if (yyin == NULL) {
         switch(errno) {
           case ENOENT:
               /* no master acl file */
-              syslog(LOG_WARNING, "You have no global acl file (%s). This is probably not a good idea.", MasterConfig->acl_file);
+              syslog(LOG_WARNING, "You have no global acl file (%s). This is probably not a good idea.", 
+                     (type == ACL_PRE ? MasterConfig->acl_file_pre : MasterConfig->acl_file_post));
               goto check_local_acl_file;
           default:
-              syslog(LOG_ERR, "Couldn't open \"%s\" acl file: %s", MasterConfig->acl_file,  strerror(errno));
+              syslog(LOG_ERR, "Couldn't open \"%s\" acl file: %s", 
+                     (type == ACL_PRE ? MasterConfig->acl_file_pre : MasterConfig->acl_file_post), strerror(errno));
               return -1;
         }
     }
@@ -277,7 +280,8 @@
         yyin = NULL;
     }
     if (rc != 0) {
-        syslog(LOG_ERR, "Parsing \"%s\" file returned with an error.", MasterConfig->acl_file);
+        syslog(LOG_ERR, "Parsing \"%s\" file returned with an error.", 
+               (type == ACL_PRE ? MasterConfig->acl_file_pre : MasterConfig->acl_file_post));
         return -1;
     }
 
@@ -301,14 +305,16 @@
     lineno = 1; operation = ACL_NONE;
 
     ListConfig = getListConfig(listname);
-    yyin = fopen(ListConfig->acl_file, "r");
+    yyin = fopen((type == ACL_PRE ? ListConfig->acl_file_pre : ListConfig->acl_file_post), "r");
     if (yyin == NULL) {
         switch(errno) {
           case ENOENT:
               /* no list acl file */
               goto finished;
           default:
-              syslog(LOG_ERR, "Couldn't open acl file \"%s\": %s", ListConfig->acl_file,  strerror(errno));
+              syslog(LOG_ERR, "Couldn't open acl file \"%s\": %s", 
+                     (type == ACL_PRE ? ListConfig->acl_file_pre : ListConfig->acl_file_post),
+                     strerror(errno));
               return -1;
         }
     }
@@ -317,7 +323,8 @@
     fclose(yyin);
     yyin = NULL;
     if (rc != 0) {
-        syslog(LOG_ERR, "Parsing \"%s\" file returned with an error.", ListConfig->acl_file);
+        syslog(LOG_ERR, "Parsing \"%s\" file returned with an error.", 
+               (type == ACL_PRE ? ListConfig->acl_file_pre : ListConfig->acl_file_post));
         return -1;
     }
 


ossp-pkg/petidomo/config-files.c 1.4 -> 1.5

--- config-files.c       2001/02/12 19:23:15     1.4
+++ config-files.c       2004/02/02 19:50:25     1.5
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/config-files.c,v $
-   $Revision: 1.4 $
+   $Revision: 1.5 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -38,7 +38,8 @@
 static char*  mta             = NULL;
 static char*  mta_options     = "-i -f%s";
 static char*  help_file       = DATADIR "/help";
-static char*  acl_file        = SYSCONFDIR "/petidomo.acl";
+static char*  acl_file_pre    = SYSCONFDIR "/petidomo.acl-pre";
+static char*  acl_file_post   = SYSCONFDIR "/petidomo.acl-post";
 static char*  index_file      = LOCALSTATEDIR "/index";
 static char*  list_dir        = LOCALSTATEDIR "/lists";
 static char*  ack_queue_dir   = LOCALSTATEDIR "/ack-queue";
@@ -56,7 +57,8 @@
         { "MTA", CF_STRING, &mta },
         { "MTAOptions", CF_STRING, &mta_options },
         { "HelpFile", CF_STRING, &help_file },
-        { "AclFile", CF_STRING, &acl_file },
+        { "AclFilePre", CF_STRING, &acl_file_pre },
+        { "AclFilePost", CF_STRING, &acl_file_post },
         { "IndexFile", CF_STRING, &index_file },
         { "ListDirectory", CF_STRING, &list_dir },
         { "AckQueueDirectory", CF_STRING, &ack_queue_dir },
@@ -115,7 +117,8 @@
     MasterConfig->mta = mta;
     MasterConfig->mta_options = mta_options;
     MasterConfig->help_file = help_file;
-    MasterConfig->acl_file = acl_file;
+    MasterConfig->acl_file_pre = acl_file_pre;
+    MasterConfig->acl_file_post = acl_file_post;
     MasterConfig->index_file = index_file;
     MasterConfig->list_dir = list_dir;
     MasterConfig->ack_queue_dir = ack_queue_dir;
@@ -142,7 +145,8 @@
 static char*     sig_file;
 static char*     desc_file;
 static char*     header_file;
-static char*     list_acl_file;
+static char*     list_acl_file_pre;
+static char*     list_acl_file_post;
 static char*     address_file;
 static char*     ack_file;
 
@@ -172,7 +176,8 @@
         { "SignatureFile", CF_STRING, &sig_file },
         { "DescriptionFile", CF_STRING, &desc_file },
         { "HeaderFile", CF_STRING, &header_file },
-        { "ACLFile", CF_STRING, &list_acl_file },
+        { "ACLFilePre", CF_STRING, &list_acl_file_pre },
+        { "ACLFilePost", CF_STRING, &list_acl_file_post },
         { "AddressFile", CF_STRING, &address_file },
         { "AcknowledgementFile", CF_STRING, &ack_file },
         { NULL, 0, NULL}
@@ -193,7 +198,8 @@
     sig_file         = "signature";
     desc_file        = "description";
     header_file      = "header";
-    list_acl_file    = "acl";
+    list_acl_file_pre  = "acl-pre";
+    list_acl_file_post = "acl-post";
     address_file     = "list";
     ack_file         = "acks";
 
@@ -301,7 +307,8 @@
     EXPAND(desc_file, desc_file);
     EXPAND(sig_file, sig_file);
     EXPAND(header_file, header_file);
-    EXPAND(acl_file, list_acl_file);
+    EXPAND(acl_file_pre, list_acl_file_pre);
+    EXPAND(acl_file_post, list_acl_file_post);
     EXPAND(address_file, address_file);
     EXPAND(ack_file, ack_file);
 


ossp-pkg/petidomo/hermes.c 1.20 -> 1.21

--- hermes.c     2001/02/17 21:37:05     1.20
+++ hermes.c     2004/02/02 19:50:25     1.21
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $
-   $Revision: 1.20 $
+   $Revision: 1.21 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -101,7 +101,7 @@
            processing is over. That's why we check the posting
            password again below. */
 
-        if (checkACL(MailStruct, listname, &operation, &parameter) != 0)
+        if (checkACL(MailStruct, listname, &operation, &parameter, ACL_PRE) != 0)
             {
             syslog(LOG_ERR, "checkACL() failed with an error.");
             exit(1);
@@ -286,6 +286,27 @@
             }
         }
 
+    /* additional ACL check */
+    if (isValidPostingPassword(MailStruct->Approve, listname) == FALSE)
+        {
+        if (checkACL(MailStruct, listname, &operation, &parameter, ACL_POST) != 0)
+            {
+            syslog(LOG_ERR, "checkACL() failed with an error.");
+            exit(1);
+            }
+        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;
+            }
+        }
+
     /* Copy the desired headers from the original mail to our own
        buffer. */
 


ossp-pkg/petidomo/listserv.c 1.8 -> 1.9

--- listserv.c   2001/02/12 20:44:13     1.8
+++ listserv.c   2004/02/02 19:50:25     1.9
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/listserv.c,v $
-   $Revision: 1.8 $
+   $Revision: 1.9 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -64,7 +64,21 @@
 
     /* Do access control. */
 
-    if (checkACL(MailStruct, NULL, &operator, &parameter) != 0) {
+    if (checkACL(MailStruct, NULL, &operator, &parameter, ACL_PRE) != 0) {
+        syslog(LOG_ERR, "checkACL() failed with an error.");
+        exit(1);
+    }
+    rc = handleACL(MailStruct, NULL, operator, parameter);
+    switch(rc) {
+      case -1:
+          syslog(LOG_ERR, "handleACL() failed with an error.");
+          exit(1);
+      case 0:
+          break;
+      case 1:
+          return;
+    }
+    if (checkACL(MailStruct, NULL, &operator, &parameter, ACL_POST) != 0) {
         syslog(LOG_ERR, "checkACL() failed with an error.");
         exit(1);
     }


ossp-pkg/petidomo/petidomo.h 1.20 -> 1.21

--- petidomo.h   2001/01/20 14:29:28     1.20
+++ petidomo.h   2004/02/02 19:50:25     1.21
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v $
-   $Revision: 1.20 $
+   $Revision: 1.21 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -64,7 +64,8 @@
     char *    list_dir;
     char *    ack_queue_dir;
     char *    help_file;
-    char *    acl_file;
+    char *    acl_file_pre;
+    char *    acl_file_post;
     char *    index_file;
     };
 
@@ -77,6 +78,12 @@
     LIST_ACKED_ONCE
     };
 
+typedef enum 
+    {
+    ACL_PRE,
+    ACL_POST
+    } acl_type_t;
+
 enum subscription_type_t
     {
     SUBSCRIPTION_PUBLIC,
@@ -99,7 +106,8 @@
     char *        desc_file;
     char *        sig_file;
     char *        header_file;
-    char *        acl_file;
+    char *        acl_file_pre;
+    char *        acl_file_post;
     char *        list_dir;
     char *        address_file;
     char *        ack_file;
@@ -156,7 +164,7 @@
 
 /********** acl.c **********/
 
-int checkACL(struct Mail *, const char *, int *, char **);
+int checkACL(struct Mail *, const char *, int *, char **, acl_type_t);
 enum
     {
     ACL_DROP,


ossp-pkg/petidomo/version.c 1.1 -> 1.2

--- version.c    2001/01/19 15:01:19     1.1
+++ version.c    2004/02/02 19:50:25     1.2
@@ -8,7 +8,7 @@
 #ifndef _VERSION_C_
 #define _VERSION_C_
 
-#define PETIDOMO_VERSION 0x400101
+#define PETIDOMO_VERSION 0x400102
 
 typedef struct {
     const int   v_hex;
@@ -32,14 +32,14 @@
 #undef  _VERSION_C_AS_HEADER_
 
 petidomo_version_t petidomo_version = {
-    0x400101,
-    "4.0b1",
-    "4.0b1 (18-Jan-2001)",
-    "This is Petidomo, Version 4.0b1 (18-Jan-2001)",
-    "Petidomo 4.0b1 (18-Jan-2001)",
-    "Petidomo/4.0b1",
-    "@(#)Petidomo 4.0b1 (18-Jan-2001)",
-    "$Id: version.c,v 1.1 2001/01/19 15:01:19 rse Exp $"
+    0x400102,
+    "4.0b2",
+    "4.0b2 (24-Apr-2002)",
+    "This is Petidomo, Version 4.0b2 (24-Apr-2002)",
+    "Petidomo 4.0b2 (24-Apr-2002)",
+    "Petidomo/4.0b2",
+    "@(#)Petidomo 4.0b2 (24-Apr-2002)",
+    "$Id: version.c,v 1.2 2004/02/02 19:50:25 thl Exp $"
 };
 
 #endif /* _VERSION_C_AS_HEADER_ */

CVSTrac 2.0.1