aboutsummaryrefslogtreecommitdiffstats
path: root/iurt2
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-06-21 18:13:17 +0000
committerFlorent Villard <warly@mandriva.com>2006-06-21 18:13:17 +0000
commitdb3ba32f534789a87ab0948256fd5d0ee4227030 (patch)
tree6cd0c35a595ce0256044dabc85eb83bed78708af /iurt2
parentb488f31dd4cd5fc528621bddcb2369c41a7f8e63 (diff)
downloadiurt-db3ba32f534789a87ab0948256fd5d0ee4227030.tar
iurt-db3ba32f534789a87ab0948256fd5d0ee4227030.tar.gz
iurt-db3ba32f534789a87ab0948256fd5d0ee4227030.tar.bz2
iurt-db3ba32f534789a87ab0948256fd5d0ee4227030.tar.xz
iurt-db3ba32f534789a87ab0948256fd5d0ee4227030.zip
fix the --shell mode to correclty update the sudoers file
Diffstat (limited to 'iurt2')
-rwxr-xr-xiurt26
1 files changed, 3 insertions, 3 deletions
diff --git a/iurt2 b/iurt2
index bdfc195..eb54322 100755
--- a/iurt2
+++ b/iurt2
@@ -431,7 +431,7 @@ if ($run{shell}) {
add_local_user($chroot_tmp, \%run, $luser, $run{uid}) or die "FATAL iurt: could not add local user";
$run{urpmi_command} = "urpmi $urpmi_options --root $chroot_tmp";
add_packages(\%run, $config, $chroot_tmp, $luser, 'sudo', 'urpmi') or die "FATAL iurt: could not add urpmi and sudo in the chroot";
- add_sudoers(\%run, $luser);
+ add_sudoers(\%run, $chroot_tmp, $luser);
if ($run{shell}) {
print {$run{LOG}} "iurt: dumping to a chrooted shell into $chroot_tmp\n";
exec "sudo chroot $chroot_tmp /bin/su $luser -c bash";
@@ -653,7 +653,7 @@ do {
my $command = "rpm --rebuild /home/$luser/rpm/SRPMS/$srpm";
if ($run{stop}) {
add_packages(\%run, $config, $chroot_tmp, $luser, 'urpmi', 'sudo');
- add_sudoers(\%run, $config, $chroot_tmp, $luser);
+ add_sudoers(\%run, $chroot_tmp, $luser);
$command = "rpm -b$run{stop} /home/$luser/rpm/SPECS/*.spec"
}
if (!perform_command(qq{TMP=/home/$luser/tmp/ sudo chroot $chroot_tmp /bin/su $luser -c "$command"},
@@ -1671,7 +1671,7 @@ sub add_packages {
}
sub add_sudoers {
- my ($run, $user) = @_;
+ my ($run, $chroot, $user) = @_;
my $file = "$chroot/etc/sudoers";
my $f;
if (!open $f, qq{| sudo sh -c "cat > $file"}) {