diff options
| author | fukachan <fukachan> | 2002-08-09 08:37:24 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-08-09 08:37:24 +0000 |
| commit | 46c87a678657020b222f138d00dca9abc3dc549b (patch) | |
| tree | a62dbe2e0c74ecf30d4183694bfe64c5eaca3582 | |
| parent | 80b8c4ce7adab0b7b33755b8bb8af6fb25afbe95 (diff) | |
| download | fml8-46c87a678657020b222f138d00dca9abc3dc549b.tar.gz fml8-46c87a678657020b222f138d00dca9abc3dc549b.tar.bz2 fml8-46c87a678657020b222f138d00dca9abc3dc549b.zip | |
validate syntax for target address to remove
check if the target address is a ML member before deluser() runs
| -rw-r--r-- | fml/lib/FML/Error.pm | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/fml/lib/FML/Error.pm b/fml/lib/FML/Error.pm index 81cd11d4..c244f294 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.1 2002/08/07 15:06:58 fukachan Exp $ +# $FML: Error.pm,v 1.2 2002/08/08 03:02:49 fukachan Exp $ # package FML::Error; @@ -97,10 +97,32 @@ sub md_analyze sub remove_bouncers { my ($self) = @_; - my $list = $self->{ _remove_addr_list }; + my $curproc = $self->{ _curproc }; + my $list = $self->{ _remove_addr_list }; + + use FML::Credential; + my $cred = new FML::Credential $curproc; + use FML::Restriction::Base; + my $safe = new FML::Restriction::Base; + my $regexp = $safe->basic_variable(); + my $addrreg = $regexp->{ address }; + + ADDR: for my $addr (@$list) { - $self->deluser( $addr ); + # check if $address is a safe string. + if ($addr =~ /^($addrreg)$/) { + if ($cred->is_member( $addr ) || $cred->is_recipient( $addr )) { + $self->deluser( $addr ); + } + else { + Log("remove_bouncers: <$addr> seems not member"); + } + } + else { + LogError("remove_bouncers: <$addr> is invalid"); + next ADDR; + } } } |
