Index: ossp-pkg/petidomo/config.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/petidomo/Attic/config.c,v' 2>/dev/null --- config.c 2001/01/06 14:12:21 1.7 +++ config.c 2001/01/08 15:55:07 1.8 @@ -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) Index: ossp-pkg/petidomo/main.c RCS File: /v/ossp/cvs/ossp-pkg/petidomo/main.c,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/petidomo/main.c,v' 2>/dev/null --- main.c 2000/12/16 13:11:54 1.3 +++ main.c 2001/01/08 15:55:07 1.4 @@ -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. */ Index: ossp-pkg/petidomo/petidomo.h RCS File: /v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v' 2>/dev/null --- petidomo.h 2001/01/06 14:12:21 1.3 +++ petidomo.h 2001/01/08 15:55:07 1.4 @@ -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 **********/