Unverified Commit 0a47c75f authored by boklm's avatar boklm
Browse files

Bug 40062: Avoid using run_chroot in copy_file_to

When copying files to a container directory, we were running `chown` on
the files using run_chroot, which in addition to using the chroot
command is doing other things like setting up mount points and other
things not needed for running `chown`. Simply using `chroot` should be
enough and faster.
parent 063c41f9
Loading
Loading
Loading
Loading
+1 −1
Changes for container: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ sub copy_file_to {
    my $filename = fileparse($src);
    rcopy($src, "$rootfsdir/$dst/$filename")
        or exit_error "Failed to copy $src to $rootfsdir/$dst/$filename";
    return run_chroot($rootfsdir, ['chown', '-R', $owner, $dst]);
    return system('/usr/sbin/chroot', $rootfsdir, 'chown', '-R', $owner, $dst);
}

sub copy_file_from {