diff options
| author | fukachan <fukachan> | 2003-01-25 09:13:35 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-01-25 09:13:35 +0000 |
| commit | cd4628ec752ca82dcee613bafada957c18d0501c (patch) | |
| tree | 586c0e491a5d44206f7d904a19c8c5db8ec4b3bc /fml/lib/FML/Process | |
| parent | 249df57be3a8f83d9381c0c7cb3c70ef7e974b86 (diff) | |
| download | fml8-cd4628ec752ca82dcee613bafada957c18d0501c.tar.gz fml8-cd4628ec752ca82dcee613bafada957c18d0501c.tar.bz2 fml8-cd4628ec752ca82dcee613bafada957c18d0501c.zip | |
get_ml_list() checks arguments matched with regxp provided by
FML::Restriction::Base.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm index b5e75160..823e9c3d 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.52 2002/12/24 10:19:47 fukachan Exp $ +# $FML: Utils.pm,v 1.53 2003/01/11 16:05:20 fukachan Exp $ # package FML::Process::Utils; @@ -912,13 +912,19 @@ sub get_ml_list my @dirlist = (); if (defined $dh) { - while ($_ = $dh->read()) { - next if /^\./; - next if /^\@/; - - # XXX-TODO: check $ml_name matches FML::Restriction::Base ? - $cf = File::Spec->catfile($prefix, $_, "config.cf"); - push(@dirlist, $_) if -f $cf; + use FML::Restriction::Base; + my $safe = new FML::Restriction::Base; + my $ml_name = ''; + + while ($ml_name = $dh->read()) { + next if $ml_name =~ /^\./o; + next if $ml_name =~ /^\@/o; + + # XXX permit $ml_name matched by FML::Restriction::Base. + if ($safe->regexp_match('ml_name', $ml_name)) { + $cf = File::Spec->catfile($prefix, $ml_name, "config.cf"); + push(@dirlist, $ml_name) if -f $cf; + } } $dh->close; } |
