From e696d615b8cfb48b227a6d627ccf3bea7eb73667 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 2 Nov 2010 21:09:24 +0000 Subject: move uid check in iurt_root_command (and fix checking return code) --- lib/Iurt/Chroot.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index e23cf6f..e34f21d 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -183,7 +183,7 @@ sub add_local_user { # if (system(qq|sudo chroot $chroot_tmp usermod -u $run->{uid} builder|)) { if ($uid) { - if (sudo($run, $config, "--useradd", $chroot_tmp, $luser, $uid) || system("$sudo chroot $chroot_tmp id $luser >/dev/null 2>&1")) { + if (!sudo($run, $config, "--useradd", $chroot_tmp, $luser, $uid)) { plog('ERR', "ERROR: setting userid $uid to $luser in " . "$chroot_tmp failed, checking the chroot"); check_build_chroot($run->{chroot_path}, $run->{chroot_tar}, $run, -- cgit v1.2.1