OSSP CVS Repository

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

Check-in Number: 253
Date: 2001-Jan-08 16:55:07 (local)
2001-Jan-08 15:55:07 (UTC)
User:simons
Branch:
Comment: Petidomo will now expect its master config file at SYSCONFDIR/petidomo.conf. This location can be changed at run-time with the command line parameter --masterconf.
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/config.c      1.7 -> 1.8     5 inserted, 5 deleted
ossp-pkg/petidomo/main.c      1.3 -> 1.4     9 inserted, 5 deleted
ossp-pkg/petidomo/petidomo.h      1.3 -> 1.4     4 inserted, 4 deleted

ossp-pkg/petidomo/config.c 1.7 -> 1.8

--- config.c     2001/01/06 14:12:21     1.7
+++ config.c     2001/01/08 15:55:07     1.8
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v $
-   $Revision: 1.7 $
+   $Revision: 1.8 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -36,7 +36,7 @@
 static char*  mta             = "/usr/sbin/sendmail";
 static char*  mta_options     = "-i -f%s";
 
-int InitPetidomo(void)
+int InitPetidomo(const char* masterconfig_path)
     {
     int    rc;
 
@@ -66,7 +66,7 @@
 
     /* Parse the config file. */
 
-    rc = ReadConfig(ETCDIR "/petidomo.conf", MasterCF);
+    rc = ReadConfig(masterconfig_path, MasterCF);
     if (rc != 0)
         {
         syslog(LOG_ERR, "Failed to parse the master config file.");
@@ -77,12 +77,12 @@
 
     if (fqdn == NULL)
         {
-        syslog(LOG_ERR, "The master config file \"petidomo.conf\" doesn't set the host name.");
+        syslog(LOG_ERR, "The master config file \"%s\" doesn't set the host name.", masterconfig_path);
         return -1;
         }
     if (master_password == NULL)
         {
-        syslog(LOG_ERR, "The master config file \"petidomo.conf\" doesn't set the admin password.");
+        syslog(LOG_ERR, "The master config file \"%s\" doesn't set the admin password.", masterconfig_path);
         return -1;
         }
     if (strstr(mta_options, "%s") == NULL)


ossp-pkg/petidomo/main.c 1.3 -> 1.4

--- main.c       2000/12/16 13:11:54     1.3
+++ main.c       2001/01/08 15:55:07     1.4
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/main.c,v $
-   $Revision: 1.3 $
+   $Revision: 1.4 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -30,8 +30,9 @@
 #  define LOG_PERROR 0
 #endif
 
-static char* listname = NULL;
-static char* mode = NULL;
+static char*  listname = NULL;
+static char*  mode = NULL;
+static char*  masterconfig_path = SYSCONFDIR "/petidomo.conf";
 
 int
 main(int argc, char * argv[])
@@ -41,6 +42,7 @@
     argv_t        args[] =
         {
         {ARGV_MAND, "mode", ARGV_CHAR_P, &mode, "mode", "listserv, deliver, or approve."},
+        {ARGV_MAYBE, "masterconf", ARGV_CHAR_P, &masterconfig_path, "masterconf", "Path to petidomo.conf."},
         {ARGV_MAYBE, 0L, ARGV_CHAR_P, &listname, "listname", "Default mailing list."},
         {ARGV_LAST}
         };
@@ -58,12 +60,14 @@
 
     /* Init Petidomo's internal stuff. */
 
-    if (InitPetidomo() != 0) {
+    if (InitPetidomo(masterconfig_path) != 0) {
         syslog(LOG_CRIT, "Failed to initialize my internals.");
         exit(1);
     }
     MasterConfig = getMasterConfig();
 
+    return 0;
+
     /* Load the file from standard input and save it, so that it isn't
        lost in case of an error. */
 


ossp-pkg/petidomo/petidomo.h 1.3 -> 1.4

--- petidomo.h   2001/01/06 14:12:21     1.3
+++ petidomo.h   2001/01/08 15:55:07     1.4
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v $
-   $Revision: 1.3 $
+   $Revision: 1.4 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -77,9 +77,9 @@
     char *        reply_to;
 };
 
-int InitPetidomo(void);
-const struct PD_Config *getMasterConfig(void  );
-const struct List_Config *getListConfig(const char *listname);
+int InitPetidomo(const char* masterconfig_path);
+const struct PD_Config *getMasterConfig(void);
+const struct List_Config *getListConfig(const char* listname);
 
 /********** rfcparse.c **********/
 

CVSTrac 2.0.1