summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-08-23 14:37:58 +0000
committerfukachan <fukachan>2003-08-23 14:37:58 +0000
commit15e0d0717d3d33942010ccd339c2839e036d97fe (patch)
treee10ae06de06697aae36ec1725020a2a46435aa1d
parentd8df85fcfa5566de082f95ebb17a68b92c19a1af (diff)
downloadfml8-15e0d0717d3d33942010ccd339c2839e036d97fe.tar.gz
fml8-15e0d0717d3d33942010ccd339c2839e036d97fe.tar.bz2
fml8-15e0d0717d3d33942010ccd339c2839e036d97fe.zip
modified to use $curproc->log*() methods.
-rw-r--r--fml/lib/FML/Article.pm14
-rw-r--r--fml/lib/FML/Article/Sequence.pm8
-rw-r--r--fml/lib/FML/Article/Summary.pm15
-rw-r--r--fml/lib/FML/Article/Thread.pm7
-rw-r--r--fml/lib/FML/Digest.pm13
-rw-r--r--fml/lib/FML/Error.pm33
-rw-r--r--fml/lib/FML/Error/Cache.pm10
-rw-r--r--fml/lib/FML/Filter.pm4
-rw-r--r--fml/lib/FML/Filter/MimeComponent3.pm16
-rw-r--r--fml/lib/FML/Header.pm7
-rw-r--r--fml/lib/FML/Mailer.pm27
-rw-r--r--fml/lib/FML/Process/Utils.pm22
-rw-r--r--fml/lib/FML/Restriction/Post.pm10
13 files changed, 95 insertions, 91 deletions
diff --git a/fml/lib/FML/Article.pm b/fml/lib/FML/Article.pm
index c16faa18..11e3799a 100644
--- a/fml/lib/FML/Article.pm
+++ b/fml/lib/FML/Article.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: Article.pm,v 1.56 2003/04/20 02:49:52 fukachan Exp $
+# $FML: Article.pm,v 1.57 2003/08/23 04:35:26 fukachan Exp $
#
package FML::Article;
@@ -76,7 +76,7 @@ sub new
if (defined $curproc->{ 'incoming_message' }->{ message }) {
_setup_article_template($curproc);
}
- $me->{ curproc } = $curproc;
+ $me->{ _curproc } = $curproc;
return bless $me, $type;
}
@@ -132,7 +132,7 @@ If the variable C<$use_spool> is 'yes', this routine works.
sub spool_in
{
my ($self, $id) = @_;
- my $curproc = $self->{ curproc };
+ my $curproc = $self->{ _curproc };
my $config = $curproc->config();
my $spool_dir = $config->{ spool_dir };
my $use_subdir = $config->{ spool_type } eq 'subdir' ? 1 : 0;
@@ -165,17 +165,17 @@ sub spool_in
print $fh "\n";
$curproc->{ article }->{ body }->print($fh);
$fh->close;
- Log("article $id");
+ $curproc->log("article $id");
}
}
else {
- LogError("$id article already exists");
+ $curproc->logerror("$id article already exists");
}
$curproc->unlock($channel);
}
else {
- Log("not spool article $id");
+ $curproc->log("not spool article $id");
}
}
@@ -222,7 +222,7 @@ sub subdirpath
sub _filepath
{
my ($self, $id) = @_;
- my $curproc = $self->{ curproc };
+ my $curproc = $self->{ _curproc };
my $config = $curproc->config();
my $spool_dir = $config->{ spool_dir };
my $use_subdir = $config->{ spool_type } eq 'subdir' ? 1 : 0;
diff --git a/fml/lib/FML/Article/Sequence.pm b/fml/lib/FML/Article/Sequence.pm
index aa2e65ca..63162c78 100644
--- a/fml/lib/FML/Article/Sequence.pm
+++ b/fml/lib/FML/Article/Sequence.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: Sequence.pm,v 1.3 2003/08/23 04:35:28 fukachan Exp $
+# $FML: Sequence.pm,v 1.4 2003/08/23 07:24:41 fukachan Exp $
#
package FML::Article::Sequence;
@@ -43,7 +43,7 @@ This routine uses C<File::Sequence> module.
sub increment_id
{
my ($self) = @_;
- my $curproc = $self->{ curproc };
+ my $curproc = $self->{ _curproc };
my $config = $curproc->config();
my $pcb = $curproc->pcb();
my $seq_file = $config->{ sequence_file };
@@ -55,7 +55,7 @@ sub increment_id
use File::Sequence;
my $sfh = new File::Sequence { sequence_file => $seq_file };
my $id = $sfh->increment_id;
- if ($sfh->error) { LogError( $sfh->error ); }
+ if ($sfh->error) { $curproc->logerror( $sfh->error ); }
# save $id in pcb (process control block) and return $id
$pcb->set('article', 'id', $id);
@@ -79,7 +79,7 @@ return the current article sequence number.
sub id
{
my ($self) = @_;
- my $curproc = $self->{ curproc };
+ my $curproc = $self->{ _curproc };
my $config = $curproc->config();
my $pcb = $curproc->pcb();
diff --git a/fml/lib/FML/Article/Summary.pm b/fml/lib/FML/Article/Summary.pm
index f1b57778..85cee211 100644
--- a/fml/lib/FML/Article/Summary.pm
+++ b/fml/lib/FML/Article/Summary.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: Summary.pm,v 1.12 2003/07/21 10:37:12 fukachan Exp $
+# $FML: Summary.pm,v 1.13 2003/08/23 04:35:28 fukachan Exp $
#
package FML::Article::Summary;
@@ -152,7 +152,7 @@ sub print_one_line_summary
$self->_fml4_compatible_style_one_line_summary($wh, $info);
}
else {
- LogError("unknown \$summary_file_style: $style");
+ $curproc->logerror("unknown \$summary_file_style: $style");
}
}
@@ -164,15 +164,16 @@ sub print_one_line_summary
sub _fml4_compatible_style_one_line_summary
{
my ($self, $wh, $info) = @_;
- my $time = $info->{ unixtime } || undef;
- my $rdate = undef;
+ my $curproc = $self->{ _curproc };
+ my $time = $info->{ unixtime } || undef;
+ my $rdate = undef;
if ($time) {
use Mail::Message::Date;
$rdate = new Mail::Message::Date $time;
}
else {
- LogError("unix time undefined");
+ $curproc->logerror("unix time undefined");
}
if (defined $rdate) {
@@ -185,7 +186,7 @@ sub _fml4_compatible_style_one_line_summary
printf $wh $format, $date, $id, $addr, $subj;
}
else {
- LogError("date object undefined.");
+ $curproc->logerror("date object undefined.");
}
}
@@ -248,7 +249,7 @@ sub rebuild
rename($tmp, $file);
}
else {
- LogError("fail to write $tmp");
+ $curproc->logerror("fail to write $tmp");
}
}
diff --git a/fml/lib/FML/Article/Thread.pm b/fml/lib/FML/Article/Thread.pm
index b8cada68..25e54855 100644
--- a/fml/lib/FML/Article/Thread.pm
+++ b/fml/lib/FML/Article/Thread.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2003 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Thread.pm,v 1.2 2003/03/16 10:48:11 fukachan Exp $
+# $FML: Thread.pm,v 1.3 2003/03/28 10:03:37 fukachan Exp $
#
package FML::Article::Thread;
@@ -183,6 +183,7 @@ sub _read_filter_list
sub close
{
my ($self, $thread, $thread_id, $min, $max) = @_;
+ my $curproc = $self->{ _curproc };
# expand MH style variable: e.g. last:100 -> [ 100 .. 200 ]
use Mail::Message::MH;
@@ -197,11 +198,11 @@ sub close
# check "elena/100" exists ?
if ($thread->exist($id)) {
- Log("close thread_id=$id");
+ $curproc->log("close thread_id=$id");
$thread->close($id);
}
else {
- Log("thread_id=$id not exists") if $debug;
+ $curproc->log("thread_id=$id not exists") if $debug;
}
}
}
diff --git a/fml/lib/FML/Digest.pm b/fml/lib/FML/Digest.pm
index 37284397..8eaf6a8f 100644
--- a/fml/lib/FML/Digest.pm
+++ b/fml/lib/FML/Digest.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: Digest.pm,v 1.9 2003/03/28 10:03:38 fukachan Exp $
+# $FML: Digest.pm,v 1.10 2003/08/23 04:35:27 fukachan Exp $
#
package FML::Digest;
@@ -124,6 +124,7 @@ sub get_article_id
sub _get_id
{
my ($self, $seq_file) = @_;
+ my $curproc = $self->{ _curproc };
# XXX-TODO: we should enhance IO::Adapter module to handle
# XXX-TODO: sequential number.
@@ -132,7 +133,7 @@ sub _get_id
my $sfh = new File::Sequence { sequence_file => $seq_file };
if (defined $sfh) {
my $id = $sfh->get_id();
- if ($sfh->error) { LogError( $sfh->error ); }
+ if ($sfh->error) { $curproc->logerror( $sfh->error ); }
return $id;
}
@@ -164,7 +165,7 @@ sub set_digest_id
my $sfh = new File::Sequence { sequence_file => $seq_file };
$sfh->set_id($id);
- if ($sfh->error) { LogError( $sfh->error ); }
+ if ($sfh->error) { $curproc->logerror( $sfh->error ); }
$curproc->unlock($channel);
@@ -198,7 +199,7 @@ sub create_multipart_message
}
};
- Log("send back articles range=$range");
+ $curproc->log("send back articles range=$range");
my $filelist = $self->_expand_range($range);
for my $filename (@$filelist) {
@@ -215,12 +216,12 @@ sub create_multipart_message
$count_ok++;
}
else {
- Log("no such file: $filepath");
+ $curproc->log("no such file: $filepath");
$count_err++;
}
}
- Log("eat articles ok=$count_ok error=$count_err");
+ $curproc->log("eat articles ok=$count_ok error=$count_err");
}
diff --git a/fml/lib/FML/Error.pm b/fml/lib/FML/Error.pm
index 8f4c2334..e7b82bd3 100644
--- a/fml/lib/FML/Error.pm
+++ b/fml/lib/FML/Error.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: Error.pm,v 1.22 2003/05/28 13:14:04 fukachan Exp $
+# $FML: Error.pm,v 1.23 2003/05/28 14:33:42 fukachan Exp $
#
package FML::Error;
@@ -180,8 +180,9 @@ module, which conceals the detail of cache structure.
sub add
{
my ($self, $info) = @_;
- my $db = $self->{ _db };
- my $addr = $info->{ address };
+ my $curproc = $self->{ _curproc };
+ my $db = $self->{ _db };
+ my $addr = $info->{ address };
if (defined $db) {
$self->lock();
@@ -189,7 +190,7 @@ sub add
$self->unlock();
}
else {
- LogError("db not open");
+ $curproc->logerror("db not open");
}
}
@@ -295,13 +296,13 @@ sub is_list_address
$cred->set_compare_level(100); # match strictly!
for my $sysaddr (@$addrs) {
if (defined $sysaddr && $sysaddr) {
- Log("check is_same_address($addr, $sysaddr)") if $debug;
+ $curproc->log("check is_same_address($addr, $sysaddr)") if $debug;
if ($cred->is_same_address($addr, $sysaddr)) {
- Log("match") if $debug;
+ $curproc->log("match") if $debug;
$match++;
}
else {
- Log("not match") if $debug;
+ $curproc->log("not match") if $debug;
}
}
}
@@ -349,21 +350,21 @@ sub remove_bouncers
$self->deluser( $addr );
}
else {
- Log("remove_bouncers: <$addr> seems not member");
+ $curproc->log("remove_bouncers: <$addr> seems not member");
}
}
else {
- LogError("remove_bouncers: <$addr> unsafe expr");
+ $curproc->logerror("remove_bouncers: <$addr> unsafe expr");
next ADDR;
}
}
else {
- LogWarn("remove_bouncers: <$addr> ignored");
+ $curproc->logwarn("remove_bouncers: <$addr> ignored");
}
}
}
else {
- LogError("undefined list");
+ $curproc->logerror("undefined list");
}
}
@@ -391,10 +392,10 @@ sub deluser
# check if $address is a safe string.
if ($safe->regexp_match('address', $address)) {
- Log("deluser <$address>");
+ $curproc->log("deluser <$address>");
}
else {
- LogError("deluser: invalid address");
+ $curproc->logerror("deluser: invalid address");
return;
}
@@ -424,11 +425,11 @@ sub deluser
}
else {
my $r = $@;
- LogError("command $method fail");
- LogError($r);
+ $curproc->logerror("command $method fail");
+ $curproc->logerror($r);
if ($r =~ /^(.*)\s+at\s+/) {
my $reason = $1;
- Log($reason); # pick up reason
+ $curproc->log($reason); # pick up reason
croak($reason);
}
}
diff --git a/fml/lib/FML/Error/Cache.pm b/fml/lib/FML/Error/Cache.pm
index f0dd27a0..8aad6f9f 100644
--- a/fml/lib/FML/Error/Cache.pm
+++ b/fml/lib/FML/Error/Cache.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: Cache.pm,v 1.11 2003/05/28 13:24:12 fukachan Exp $
+# $FML: Cache.pm,v 1.12 2003/08/23 04:35:34 fukachan Exp $
#
package FML::Error::Cache;
@@ -122,6 +122,7 @@ following a set of key ($address) and value.
sub add
{
my ($self, $address, $argv) = @_;
+ my $curproc = $self->{ _curproc };
$self->_open_cache();
@@ -137,7 +138,7 @@ sub add
$reason =~ s/\s+/_/g;
}
else {
- LogError("FML::Error::Cache: add: not implemented \$argv type");
+ $curproc->logerror("FML::Error::Cache: add: not implemented \$argv type");
return undef;
}
@@ -145,7 +146,7 @@ sub add
$db->{ $address } = "$unixtime status=$status reason=$reason";
}
else {
- LogWarn("FML::Error::Cache: add: invalid data");
+ $curproc->logwarn("FML::Error::Cache: add: invalid data");
}
$self->_close_cache();
@@ -170,6 +171,7 @@ delete entry for $address.
sub delete
{
my ($self, $address) = @_;
+ my $curproc = $self->{ _curproc };
$self->_open_cache();
@@ -179,7 +181,7 @@ sub delete
delete $db->{ $address };
}
else {
- LogWarn("FML::Error::Cache: delete: invalid data");
+ $curproc->logwarn("FML::Error::Cache: delete: invalid data");
}
$self->_close_cache();
diff --git a/fml/lib/FML/Filter.pm b/fml/lib/FML/Filter.pm
index 512260a3..6d9f3550 100644
--- a/fml/lib/FML/Filter.pm
+++ b/fml/lib/FML/Filter.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: Filter.pm,v 1.32 2003/08/23 04:35:27 fukachan Exp $
+# $FML: Filter.pm,v 1.33 2003/08/23 07:24:40 fukachan Exp $
#
package FML::Filter;
@@ -243,7 +243,7 @@ sub _apply_article_mime_component_filter
if ($config->yes( 'use_article_mime_component_filter' )) {
use FML::Filter::MimeComponent3;
- my $obj = new FML::Filter::MimeComponent;
+ my $obj = new FML::Filter::MimeComponent $curproc;
my $file = $config->get('article_mime_component_filter_rules');
if (-f $file) {
diff --git a/fml/lib/FML/Filter/MimeComponent3.pm b/fml/lib/FML/Filter/MimeComponent3.pm
index 10d16c0d..1781a873 100644
--- a/fml/lib/FML/Filter/MimeComponent3.pm
+++ b/fml/lib/FML/Filter/MimeComponent3.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: MimeComponent3.pm,v 1.15 2003/08/16 15:45:03 fukachan Exp $
+# $FML: MimeComponent3.pm,v 1.16 2003/08/23 04:35:35 fukachan Exp $
#
package FML::Filter::MimeComponent;
@@ -64,9 +64,9 @@ my $filter_rules = [
# Return Value: OBJ
sub new
{
- my ($self) = @_;
+ my ($self, $curproc) = @_;
my ($type) = ref($self) || $self;
- my $me = {};
+ my $me = { _curproc => $curproc };
return bless $me, $type;
}
@@ -102,6 +102,7 @@ sub mime_component_check
{
my ($self, $msg, $args) = @_;
my ($data_type, $prevmp, $nextmp, $mp, $action, $reject_reason);
+ my $curproc = $self->{ _curproc };
my $is_cutoff = 0; # debug
my $i = 1;
my $j = 1;
@@ -168,7 +169,7 @@ sub mime_component_check
# reject if no effective part.
unless ($self->_has_effective_part($msg)) {
my $reason = "no effective part in this multipart";
- Log($reason);
+ $curproc->log($reason);
$count{ 'reject' }++;
$reason{ 'reject' } = $reject_reason = $reason;
}
@@ -199,7 +200,7 @@ sub mime_component_check
}
$_reason ||= "default action";
- Log("mime_component_filter: $decision ($_reason)");
+ $curproc->log("mime_component_filter: $decision ($_reason)");
__dprint("\n our desicion: $decision ($_reason)");
if ($decision eq 'reject') {
@@ -307,6 +308,7 @@ sub __basic_regexp_match
sub _cutoff
{
my ($self, $mp) = @_;
+ my $curproc = $self->{ _curproc };
my $data_type = $mp->data_type();
my $prevmp = $mp->{ prev };
@@ -314,13 +316,13 @@ sub _cutoff
my $prev_type = $prevmp->data_type();
if ($prev_type eq "multipart.delimiter") {
$prevmp->delete_message_part_link();
- Log("delete multipart delimiter");
+ $curproc->log("delete multipart delimiter");
}
}
$mp->delete_message_part_link();
- Log("delete $data_type");
+ $curproc->log("delete $data_type");
}
diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm
index ff568952..18651f9d 100644
--- a/fml/lib/FML/Header.pm
+++ b/fml/lib/FML/Header.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: Header.pm,v 1.61 2003/06/25 13:10:50 tmu Exp $
+# $FML: Header.pm,v 1.62 2003/08/23 04:35:27 fukachan Exp $
#
package FML::Header;
@@ -394,7 +394,7 @@ sub rewrite_article_subject_tag
$pkg->rewrite_article_subject_tag($header, $config, $args);
}
else {
- LogError("cannot load $pkg");
+ croak("cannot load $pkg");
}
}
@@ -442,8 +442,6 @@ sub rewrite_date
$header->add('X-Date', $orgdate) if ($orgdate);
$header->replace('Date', $newdate);
- Log("(debug) rewrite the orginal date to 'X-Date: $orgdate'") if $debug;
- Log("(debug) rewrite the new date to 'Date: $newdate'") if $debug;
}
@@ -464,7 +462,6 @@ sub rewrite_received
$header->add($new, $data);
}
$header->delete($org);
- Log("(debug) rewrite $org to $new (total $num)") if $debug;
}
diff --git a/fml/lib/FML/Mailer.pm b/fml/lib/FML/Mailer.pm
index 814a4d40..f9f1526a 100644
--- a/fml/lib/FML/Mailer.pm
+++ b/fml/lib/FML/Mailer.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: Mailer.pm,v 1.18 2003/08/23 04:35:28 fukachan Exp $
+# $FML: Mailer.pm,v 1.19 2003/08/23 08:50:43 fukachan Exp $
#
package FML::Mailer;
@@ -99,17 +99,17 @@ sub send
my $fp = undef;
my $sfp = undef;
my $maintainer = undef;
+ my $curproc = $self->{ _curproc };
# 0. fundamental environment
# $curproc is given in usual fml processes.
# but not in other programs.
- if (defined $args->{ curproc }) {
- my $curproc = $args->{ curproc };
+ if (defined $curproc) {
my $config = $curproc->{ config };
$maintainer = $config->{ maintainer } if defined $config;
# default log functions
- $fp = sub { Log(@_);}; # pointer to the log function
+ $fp = sub { $curproc->log(@_);}; # pointer to the log function
$sfp = sub { my ($s) = @_; print $s; print "\n" if $s !~ /\n$/o;};
# overwrite smtp log channel
@@ -121,14 +121,14 @@ sub send
}
}
else {
- LogError("FML::Mailer: curproc not specified");
+ $curproc->logerror("FML::Mailer: curproc not specified");
return 0;
}
# 1. sender
my $sender = (defined $args->{sender} ? $args->{sender} : $maintainer);
unless ($sender) {
- LogError("FML::Mailer: no sender");
+ $curproc->logerror("FML::Mailer: no sender");
return 0;
}
@@ -142,7 +142,7 @@ sub send
$recipients = [ $recipient ];
}
else {
- LogError("FML::Mailer: no recipient(s)");
+ $curproc->logerror("FML::Mailer: no recipient(s)");
return 0;
}
@@ -154,7 +154,7 @@ sub send
$message = $args->{ message };
}
else {
- LogError("FML::Mailer: no message");
+ $curproc->logerror("FML::Mailer: no message");
return 0;
}
@@ -168,12 +168,12 @@ sub send
$message = Mail::Message->parse( { fd => $fh } );
}
else {
- LogError("FML::Mailer: no such file ($file)");
+ $curproc->logerror("FML::Mailer: no such file ($file)");
}
}
unless (defined $message) {
- LogError("FML::Mailer: no message");
+ $curproc->logerror("FML::Mailer: no message");
return 0;
}
@@ -181,15 +181,14 @@ sub send
#
# main
#
- my $curproc = $args->{ curproc };
- my $config = $curproc->{ config };
+ my $config = $curproc->{ config };
use Mail::Delivery;
my $service = new Mail::Delivery {
log_function => $fp,
smtp_log_function => $sfp,
smtp_log_handle => $handle,
};
- if ($service->error) { LogError($service->error); return 0;}
+ if ($service->error) { $curproc->logerror($service->error); return 0;}
$service->deliver({
'smtp_sender' => $sender,
@@ -197,7 +196,7 @@ sub send
'message' => $message,
map_params => $config,
});
- if ($service->error) { LogError($service->error); return 0;}
+ if ($service->error) { $curproc->logerror($service->error); return 0;}
return 1;
}
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 20c73b2c..3fd55a92 100644
--- a/fml/lib/FML/Process/Utils.pm
+++ b/fml/lib/FML/Process/Utils.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: Utils.pm,v 1.71 2003/08/20 23:40:29 fukachan Exp $
+# $FML: Utils.pm,v 1.72 2003/08/23 07:24:48 fukachan Exp $
#
package FML::Process::Utils;
@@ -286,12 +286,12 @@ sub mkdir
unless (-d $dir) {
if (defined $mode) {
if ($mode =~ /^\d+$/) { # NUM 0700
- _mkpath_num($dir, $mode);
+ $curproc->_mkpath_num($dir, $mode);
}
elsif ($mode =~ /mode=(\S+)/) {
my $xmode = "directory_${1}_mode";
if (defined $config->{ $xmode }) {
- _mkpath_str($dir, $config->{ $xmode });
+ $curproc->_mkpath_str($dir, $config->{ $xmode });
}
else {
$curproc->logerror("mkdir: invalid mode");
@@ -302,7 +302,7 @@ sub mkdir
}
}
elsif ($dirmode =~ /^\d+$/) { # STR 0700
- _mkpath_str($dir, $dirmode);
+ $curproc->_mkpath_str($dir, $dirmode);
}
else {
$curproc->logerror("mkdir: invalid mode");
@@ -319,7 +319,7 @@ sub mkdir
# Return Value: none
sub _mkpath_num
{
- my ($dir, $mode) = @_;
+ my ($curproc, $dir, $mode) = @_;
my $cur_mask = umask();
umask(0);
@@ -328,10 +328,10 @@ sub _mkpath_num
eval q{ use File::Path;};
mkpath([ $dir ], 0, $mode);
chmod $mode, $dir;
- Log(sprintf("mkdir %s mode=0%o", $dir, $mode));
+ $curproc->log(sprintf("mkdir %s mode=0%o", $dir, $mode));
}
else {
- LogError("mkdir: invalid mode (N)");
+ $curproc->logerror("mkdir: invalid mode (N)");
}
umask($cur_mask);
@@ -344,7 +344,7 @@ sub _mkpath_num
# Return Value: none
sub _mkpath_str
{
- my ($dir, $mode) = @_;
+ my ($curproc, $dir, $mode) = @_;
my $cur_mask = umask();
umask(0);
@@ -354,12 +354,12 @@ sub _mkpath_str
use File::Path;
mkpath([ \$dir ], 0, $mode);
chmod $mode, \$dir;
- Log(\"mkdirhier \$dir mode=$mode\");
+ $curproc->log(\"mkdirhier \$dir mode=$mode\");
};
- LogError($@) if $@;
+ $curproc->logerror($@) if $@;
}
else {
- LogError("mkdir: invalid mode (S)");
+ $curproc->logerror("mkdir: invalid mode (S)");
}
umask($cur_mask);
diff --git a/fml/lib/FML/Restriction/Post.pm b/fml/lib/FML/Restriction/Post.pm
index ec861398..b707b594 100644
--- a/fml/lib/FML/Restriction/Post.pm
+++ b/fml/lib/FML/Restriction/Post.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: Post.pm,v 1.4 2003/08/01 05:00:58 tmu Exp $
+# $FML: Post.pm,v 1.5 2003/08/03 14:46:41 fukachan Exp $
#
package FML::Restriction::Post;
@@ -55,7 +55,7 @@ sub reject_system_accounts
my $pcb = $curproc->{ pcb };
if ($match) {
- Log("${rule}: $match matches sender address");
+ $curproc->log("${rule}: $match matches sender address");
unless ($pcb->get("check_restrictions", "deny_reason")) {
$pcb->set("check_restrictions", "deny_reason", $rule);
}
@@ -96,8 +96,8 @@ sub permit_member_maps
}
else {
# A: No, deny distribution
- LogError("$sender is not an ML member");
- LogError( $cred->error() );
+ $curproc->logerror("$sender is not an ML member");
+ $curproc->logerror( $cred->error() );
# reply this info in each FML::Process::* module.
# $curproc->reply_message_nl('error.not_member',
@@ -131,7 +131,7 @@ sub permit_commands_for_stranger
use FML::Command::DataCheck;
my $check = new FML::Command::DataCheck;
if ($check->find_commands_for_stranger($curproc)) {
- Log("$rule matched. accepted.");
+ $curproc->log("$rule matched. accepted.");
return("matched", "permit");
}