From 43447dae9a616c92bd4ca5910002d162c06a611f Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 24 Mar 2012 15:36:34 +0000 Subject: perl_checker cleanups --- iurt_root_command | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'iurt_root_command') diff --git a/iurt_root_command b/iurt_root_command index b02f5ad..fad6c13 100755 --- a/iurt_root_command +++ b/iurt_root_command @@ -23,7 +23,7 @@ use strict; my $program_name = 'iurt_root_command'; use Mkcd::Commandline qw(parseCommandLine usage); -use MDK::Common qw(if_); +use MDK::Common qw(any if_); use File::NCopy qw(copy); use Iurt::Util qw(plog_init plog); use Cwd 'realpath'; @@ -35,7 +35,7 @@ my $arg = @ARGV; my (@params, %run); $run{program_name} = $program_name; -my %authorized_modules = (); +my %authorized_modules; my %authorized_rw_bindmounts = (map { $_ => 1 } qw(/proc /dev/pts /var/cache/icecream)); $run{todo} = []; @@ -203,7 +203,7 @@ sub modprobe { return 0; } - return 1 if grep { /^$module\b/ } read_file("/proc/modules"); + return 1 if any { /^$module\b/ } read_file("/proc/modules"); system("/sbin/depmod", "-a"); !system("/sbin/modprobe", "-f", $module); @@ -373,7 +373,7 @@ sub untar { return; } check_path_authorized($file) && check_path_authorized($dir) or return; - if (grep { /^-/ } @o_files) { + if (any { /^-/ } @o_files) { plog('FAIL', "untar: options forbidden"); return; } -- cgit v1.2.1