diff options
author | Olivier Blin <blino@mageia.org> | 2010-11-02 07:03:35 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2010-11-02 07:03:35 +0000 |
commit | 3cd2ea382ff6c119b178ee5479135eb31caac4a1 (patch) | |
tree | c6af1bf4d3cb595bc742da6e17aa675d52b713dc /lib/Iurt/Chroot.pm | |
parent | 67eca73dba906de09c873a6bc328e3e6c941d0a9 (diff) | |
download | iurt-3cd2ea382ff6c119b178ee5479135eb31caac4a1.tar iurt-3cd2ea382ff6c119b178ee5479135eb31caac4a1.tar.gz iurt-3cd2ea382ff6c119b178ee5479135eb31caac4a1.tar.bz2 iurt-3cd2ea382ff6c119b178ee5479135eb31caac4a1.tar.xz iurt-3cd2ea382ff6c119b178ee5479135eb31caac4a1.zip |
don't copy /home/builder for new users, just create the user with iurt_root_command and dump again the rpmmacros file
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r-- | lib/Iurt/Chroot.pm | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 421f5d7..23d4992 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -190,11 +190,8 @@ sub add_local_user { sudo($run, $config, "--mkdir", "$chroot_tmp/home/builder/rpm/$p"); } - dump_rpmmacros($run, $config, "$chroot_tmp/home/builder/.rpmmacros") or return; - if ($uid) { - if (system($sudo, 'chroot', $chroot_tmp, 'useradd', '-M', '-u', $uid, $luser) || - system("$sudo chroot $chroot_tmp id $luser >/dev/null 2>&1")) { + if (sudo($run, $config, "--useradd", $chroot_tmp, $luser, $uid) || system("$sudo chroot $chroot_tmp id $luser >/dev/null 2>&1")) { 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, @@ -205,14 +202,7 @@ sub add_local_user { system($sudo, 'chroot', $chroot_tmp, 'usermod', '-d', "/home/$luser", '-u', $uid, '-o', '-l', $luser, 'root'); } - if (system(qq($sudo chroot $chroot_tmp cp -R /home/builder /home/$luser))) { - plog("ERROR: could not initialized $luser directory"); - return; - } - - if (system(qq($sudo chroot $chroot_tmp chown -R $uid /home/$luser))) { - die "ERROR $program_name: could not initialized $luser directory\n"; - } + dump_rpmmacros($run, $config, "$chroot_tmp/home/$luser/.rpmmacros") or return; 1; } |