summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-01-14 13:39:58 +0000
committerfukachan <fukachan>2004-01-14 13:39:58 +0000
commitf3b3392b40e2e2ba67b6de3257f2d982f6b9c062 (patch)
tree7fbfc760d09b3ed4df6c7d1504e7d7a598f2357f
parent3838eb20aa42a6689e5c6a208de8bde05143db17 (diff)
downloadfml8-f3b3392b40e2e2ba67b6de3257f2d982f6b9c062.tar.gz
fml8-f3b3392b40e2e2ba67b6de3257f2d982f6b9c062.tar.bz2
fml8-f3b3392b40e2e2ba67b6de3257f2d982f6b9c062.zip
load_config_files() not need the argument.
load_config_files() do sanity checks for mta and cgi processes.
-rw-r--r--fml/lib/FML/Process/Kernel.pm38
1 files changed, 24 insertions, 14 deletions
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm
index ddc58aab..6b9eb1c3 100644
--- a/fml/lib/FML/Process/Kernel.pm
+++ b/fml/lib/FML/Process/Kernel.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Kernel.pm,v 1.204 2004/01/02 14:50:36 fukachan Exp $
+# $FML: Kernel.pm,v 1.205 2004/01/03 01:53:47 fukachan Exp $
#
package FML::Process::Kernel;
@@ -886,28 +886,38 @@ $config->get() of FETCH() method is called.
sub load_config_files
{
my ($curproc, $files) = @_;
+ my $config = $curproc->config();
+ my $_files = $files || $curproc->get_config_files_list();
# load configuration variables from given files e.g. /some/where.cf
# XXX overload variables from each $cf
- for my $cf (@$files) {
- $curproc->config()->overload( $cf );
+ for my $cf (@$_files) {
+ $config->overload( $cf );
}
# XXX We need to expand variables after we load all *cf files.
# XXX 2001/05/05 changed to dynamic expansion for hook
# $curproc->config()->expand_variables();
- # XXX simple sanity check
- # MAIL_LIST != MAINTAINER
- my $config = $curproc->config();
- my $maintainer = $config->{ maintainer };
- my $ml_address = $config->{ address_for_post };
-
- use FML::Credential;
- my $cred = new FML::Credential $curproc;
- if ($cred->is_same_address($maintainer, $ml_address)) {
- $curproc->logerror("invalid configuration: \$maintainer == \$address_for_post");
- $curproc->stop_this_process("configuration error");
+ if ($curproc->is_cgi_process() || $curproc->is_under_mta_process()) {
+ # XXX simple sanity check
+ # MAIL_LIST != MAINTAINER
+ my $maintainer = $config->{ maintainer } || '';
+ my $ml_address = $config->{ address_for_post } || '';
+
+ unless ($maintainer) {
+ my $s = "configuration error: \$maintainer undefined";
+ $curproc->logerror($s);
+ $curproc->stop_this_process("configuration error");
+ }
+
+ use FML::Credential;
+ my $cred = new FML::Credential $curproc;
+ if ($cred->is_same_address($maintainer, $ml_address)) {
+ my $s = "configuration error: \$maintainer == \$address_for_post";
+ $curproc->logerror($s);
+ $curproc->stop_this_process("configuration error");
+ }
}
}