proot-me / proot

chroot, mount --bind, and binfmt_misc without privilege/setup for Linux
https://proot-me.github.io
GNU General Public License v2.0
1.96k stars 369 forks source link

Some directories are not visible on android #345

Closed real-artswan closed 1 year ago

real-artswan commented 1 year ago

Expected Behavior

When I proot to some directory with -r parameter I expect everything inside the directory is accessible from the guest.

Actual Behavior

Not all directories are accessible.

Steps to Reproduce the Problem

With Android phone

  1. adb shell
  2. run-as com.octo4a
  3. go into bootstrapped dir (there are alpine root and some helper scripts)
  4. try to proot into bootstrapped alpine root

Specifications

built-in accelerators: process_vm = no, seccomp_filter = yes

Visit http://proot.me for help, bug reports, suggestions, patchs, ... Copyright (C) 2015 STMicroelectronics, licensed under GPL v2 or later. // Refined by Alex Kiselev see https://github.com/green-green-avk/proot for details.

  - Kernel version:

a10s:/data/user/0/com.octo4a/files/bootstrap $ uname -r 4.19.127-22945975

  - Host distribution: Android 11 (samsung a10s)
  - Guest distribution: 

/ # cat /etc/alpine-release 3.17.1


## Command Output

on the host

a10s:/data/user/0/com.octo4a/files/bootstrap $ whoami u0_a227

1|a10s:/data/user/0/com.octo4a/files/bootstrap $ ls -la bootstrap/
total 152 drwx------ 19 u0_a227 u0_a227 4096 2023-02-28 16:51 . drwxrwxrwx 6 u0_a227 u0_a227 4096 2023-02-28 16:35 .. drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 bin drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 dev drwx------ 17 u0_a227 u0_a227 4096 2023-02-28 16:24 etc drwx------ 2 u0_a227 u0_a227 4096 2023-02-28 16:51 home drwx------ 7 u0_a227 u0_a227 4096 2023-01-09 14:47 lib drwx------ 5 u0_a227 u0_a227 4096 2023-01-09 14:47 media drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 mnt drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 opt dr-x------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 proc drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 root drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 run drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 sbin drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 srv drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 sys drwx------ 2 u0_a227 u0_a227 4096 2023-01-09 14:47 tmp drwx------ 7 u0_a227 u0_a227 4096 2023-01-09 14:47 usr drwx------ 12 u0_a227 u0_a227 4096 2023-01-09 14:47 var

On the guest after prooting

a10s:/data/user/0/com.octo4a/files/bootstrap $ PATH='/sbin:/usr/sbin:/bin:/usr/bin' ./root/bin/proot -r ./bootstrap -0 -w / --link2symlink -L /bin/sh
proot warning: can't canonicalize /tmp/: No such file or directory proot warning: Unable to create temp directory for f2fs bug probe: No such file or directory / # ls -la / ls: /home: No such file or directory ls: /tmp: No such file or directory ls: /usr: No such file or directory ls: /opt: No such file or directory ls: /lib: No such file or directory ls: /srv: No such file or directory ls: /run: No such file or directory ls: /root: No such file or directory ls: /var: No such file or directory ls: /media: No such file or directory ls: /sbin: No such file or directory total 8 drwxr-xr-x 25 root root 4096 Dec 31 2008 . drwxr-xr-x 25 root root 4096 Dec 31 2008 .. ls: /bin: cannot read link: not a symlink lrw-r--r-- 1 root root 11 Dec 31 2008 bin drwxr-xr-x 25 root root 3900 Mar 1 22:10 dev ls: /etc: cannot read link: not a symlink lrw-r--r-- 1 root root 11 Dec 31 2008 etc drwxr-xr-x 17 root 1000 360 Mar 1 22:10 mnt dr-xr-xr-x 536 root root 0 Jan 1 1970 proc dr-xr-xr-x 14 root root 0 Mar 1 22:10 sys

/ # whoami root


(sorry about warning about temp directory, it is irrelevant, I've just forgot to set it)

Finally, questions are: is it android 11 or this specific phone issue? is it proot issue? is it proot compilation config/linked libs issue? is it alpine issue?  what happens and how to debug it further?
btw related issue on octo4a (actually there are a few similar) https://github.com/feelfreelinux/octo4a/issues/379
oxr463 commented 1 year ago

That is not a version of PRoot from this repository. The output text has very old information (like the website link) and the last line contains a different GitHub repository than here. I’d advise reaching out to them for assistance.