diff options
author | Olivier Blin <blino@mageia.org> | 2010-11-04 12:00:09 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2010-11-04 12:00:09 +0000 |
commit | 799e27cd6ba17242859b0a55a91f922447179bdd (patch) | |
tree | 6d5117ab1a74833103e902b217524088b43a671c /iurt_root_command | |
parent | ce850e9ed3cd1fba471dcce3ad0f9700c37929f5 (diff) | |
download | iurt-799e27cd6ba17242859b0a55a91f922447179bdd.tar iurt-799e27cd6ba17242859b0a55a91f922447179bdd.tar.gz iurt-799e27cd6ba17242859b0a55a91f922447179bdd.tar.bz2 iurt-799e27cd6ba17242859b0a55a91f922447179bdd.tar.xz iurt-799e27cd6ba17242859b0a55a91f922447179bdd.zip |
add chroot support in iurt_root_command
Diffstat (limited to 'iurt_root_command')
-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); +} |