aboutsummaryrefslogtreecommitdiffstats
path: root/iurt_root_command
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2010-11-04 12:00:09 +0000
committerOlivier Blin <blino@mageia.org>2010-11-04 12:00:09 +0000
commit799e27cd6ba17242859b0a55a91f922447179bdd (patch)
tree6d5117ab1a74833103e902b217524088b43a671c /iurt_root_command
parentce850e9ed3cd1fba471dcce3ad0f9700c37929f5 (diff)
downloadiurt-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-xiurt_root_command12
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);
+}