[tor-commits] [Git][tpo/applications/rbm][main] Bug 40063: Set PATH when using chroot
richard (@richard)
git at gitlab.torproject.org
Wed Nov 22 17:11:20 UTC 2023
richard pushed to branch main at The Tor Project / Applications / RBM
Commits:
40acf540 by Nicolas Vigier at 2023-11-15T10:42:52+01:00
Bug 40063: Set PATH when using chroot
This should fix an issue on Fedora (Thanks to @NoisyCoil for reporting
it).
- - - - -
1 changed file:
- container
Changes:
=====================================
container
=====================================
@@ -95,7 +95,9 @@ sub run_chroot {
# On some systems resolv.conf is a symlink (see #40015)
local $File::Copy::Recursive::CopyLink = 0;
fcopy('/etc/resolv.conf', "$rootfsdir/etc/resolv.conf");
- local %ENV = ();
+ local %ENV = (
+ PATH => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ );
path("$rootfsdir/etc/hosts")->append("\n127.0.1.1 rbm\n")
unless grep { m/^127.0.1.1 rbm$/ } path("$rootfsdir/etc/hosts")->lines;
system('hostname', 'rbm');
@@ -110,6 +112,9 @@ sub copy_file_to {
my $filename = fileparse($src);
rcopy($src, "$rootfsdir/$dst/$filename")
or exit_error "Failed to copy $src to $rootfsdir/$dst/$filename";
+ local %ENV = (
+ PATH => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+ );
return system('/usr/sbin/chroot', $rootfsdir, 'chown', '-R', $owner, $dst);
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/40acf540fe75055df2eb78454f070f57d0804729
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/40acf540fe75055df2eb78454f070f57d0804729
You're receiving this email because of your account on gitlab.torproject.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20231122/182bf6ee/attachment-0001.htm>
More information about the tor-commits
mailing list