Sunday, December 29, 2019

Re: How to use proot?

Marc Espie <espie@nerim.net> writes:

> On Sun, Dec 29, 2019 at 02:21:21AM -0800, Xiyue Deng wrote:
>> Sure thing. It's not very interesting and looks like below:
>>
>> $ mount
>> /dev/wd0a on / type ffs (local, wxallowed, softdep)
>>
>> (So basically my whole disk is mounted on /)
>
> ... and there was a bug in my logic because I never got a proot straight
> mounted under /. It's now fixed.
>
>
> Index: proot
> ===================================================================
> RCS file: /cvs/ports/infrastructure/bin/proot,v
> retrieving revision 1.66
> diff -u -p -r1.66 proot
> --- proot 6 Dec 2019 13:40:46 -0000 1.66
> +++ proot 29 Dec 2019 10:34:54 -0000
> @@ -474,10 +474,15 @@ sub check_mountpoint
> }
> }
> my $mnt = $root;
> - do {{
> + while (1) {
> if (!defined $dev->{$mnt}) {
> - $mnt = dirname($mnt);
> - next;
> + my $up = dirname($mnt);
> + if ($mnt eq $up) {
> + last;
> + } else {
> + $mnt = $up;
> + next;
> + }
> }
> $state->errsay("#1 is under #2 which is nodev", $root, $mnt)
> if $dev->{$mnt} == 0;
> @@ -485,8 +490,8 @@ sub check_mountpoint
> $root, $mnt) if $nosuid->{$mnt} == 0;
> $state->errsay("#1 is under #2 which does not have wxallowed",
> $root, $mnt) if $wx->{$mnt} == 0;
> - return;
> - }} while ($mnt ne dirname($mnt));
> + return;
> + }
> $state->fatal_error("Couldn't find mountpoint for #1 ???", $root);
> }
>

It's working now! Thanks Marc for the quick fix!

No comments:

Post a Comment