From 799e27cd6ba17242859b0a55a91f922447179bdd Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 4 Nov 2010 12:00:09 +0000 Subject: add chroot support in iurt_root_command --- iurt_root_command | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'iurt_root_command') 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); +} -- cgit v1.2.1