aboutsummaryrefslogtreecommitdiffstats
path: root/iurt_root_command
diff options
context:
space:
mode:
Diffstat (limited to 'iurt_root_command')
-rwxr-xr-xiurt_root_command9
1 files changed, 3 insertions, 6 deletions
diff --git a/iurt_root_command b/iurt_root_command
index 9db3404..8a27a39 100755
--- a/iurt_root_command
+++ b/iurt_root_command
@@ -203,12 +203,9 @@ sub modprobe {
plog("ERROR: unauthorized module $module");
return 0;
}
- open my $modules, '/proc/modules';
- while (my $m = <$modules>) {
- if ($m =~ /unionfs/) {
- return 1;
- }
- }
+
+ return 1 if grep { /^$module\b/ } read_file("/proc/modules");
+
system("/sbin/depmod", "-a");
!system("/sbin/modprobe", "-f", $module);
}