From 5b45d3c5a8c61f076370b6ca3d14abeeceed5009 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 3 Dec 2002 12:05:29 +0000 Subject: simplify (esp. use cat_) --- perl-install/security/msec.pm | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'perl-install/security') diff --git a/perl-install/security/msec.pm b/perl-install/security/msec.pm index 16774228b..bba1bc78b 100644 --- a/perl-install/security/msec.pm +++ b/perl-install/security/msec.pm @@ -157,10 +157,7 @@ sub get_functions { # read mseclib.py to get each function's name and if it's # not in the ignore list, add it to the returned list. - local *F; - open F, $file; - local $_; - while () { + foreach (cat_($file)) { if (/^def/) { (undef, $function) = split(/ /, $_); ($function, undef) = split(/\(/, $function); @@ -169,7 +166,6 @@ sub get_functions { } } } - close F; @functions; } @@ -207,21 +203,7 @@ sub config_function { # get_default_checks() - # return a list of periodic checks handled by security.conf sub get_default_checks { - my ($check, @checks); - - my $check_file = "$::prefix/var/lib/msec/security.conf"; - - if (-e $check_file) { - local *F; - open F, $check_file; - local $_; - while () { - ($check, undef) = split(/=/, $_); - push @checks, $check unless member($check, qw(MAIL_USER)) - } - close F; - } - @checks; + map { if(/(.*?)=/, $1) } cat_("$::prefix/var/lib/msec/security.conf"); } # get_check_value(check) -- cgit v1.2.1