diff options
-rwxr-xr-x | iurt_root_command | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/iurt_root_command b/iurt_root_command index e54ce76..cd0fedd 100755 --- a/iurt_root_command +++ b/iurt_root_command @@ -159,6 +159,7 @@ $run{todo} = []; my %commands_with_more_args = ( "--urpmi" => [ \&urpmi, "urpmi" ], + "--chroot" => [ \&run_chroot, "chroot" ], ); open(my $LOG, ">&STDERR"); @@ -446,3 +447,14 @@ sub urpmi { my ($_run, @options) = @_; return check_urpmi_chroot_options(\@options) && !system('urpmi', @options); } + +sub run_chroot { + my ($_run, $dir, @options) = @_; + if (!$dir) { + plog('FAIL', "chroot: need directory argument"); + return; + } + check_path_authorized($dir) or return; + + return !system("chroot", $dir, @options); +} |