Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown directory attributes when viewed by non-root user in proot #362

Open
capslockwizard opened this issue Jul 7, 2023 · 1 comment

Comments

@capslockwizard
Copy link

Expected Behavior

Directories with normal directory attributes

Actual Behavior

When I do ls -lth /, I get:

ls: cannot access 'boot': No such file or directory
ls: cannot access 'etc': No such file or directory
ls: cannot access 'home': No such file or directory
ls: cannot access 'media': No such file or directory
ls: cannot access 'mnt': No such file or directory
ls: cannot access 'opt': No such file or directory
ls: cannot access 'root': No such file or directory
ls: cannot access 'run': No such file or directory
ls: cannot access 'srv': No such file or directory
ls: cannot access 'tmp': No such file or directory
ls: cannot access 'usr': No such file or directory
ls: cannot access 'bin': No such file or directory
ls: cannot access 'lib': No such file or directory
ls: cannot access 'lib32': No such file or directory
ls: cannot access 'lib64': No such file or directory
ls: cannot access 'libx32': No such file or directory
ls: cannot access 'sbin': No such file or directory
ls: cannot access 'var': No such file or directory
total 0
dr-xr-xr-x 13 root root 0 Jul 7 07:47 sys
dr-xr-xr-x 530 root root 0 May 9 16:46 proc
drwxr-xr-x 20 root root 3.4K May 9 07:47 dev
l????????? ? ? ? ? ? bin
d????????? ? ? ? ? ? boot
d????????? ? ? ? ? ? etc
d????????? ? ? ? ? ? home
l????????? ? ? ? ? ? lib
l????????? ? ? ? ? ? lib32
l????????? ? ? ? ? ? lib64
l????????? ? ? ? ? ? libx32
d????????? ? ? ? ? ? media
d????????? ? ? ? ? ? mnt
d????????? ? ? ? ? ? opt
d????????? ? ? ? ? ? root
d????????? ? ? ? ? ? run
l????????? ? ? ? ? ? sbin
d????????? ? ? ? ? ? srv
d????????? ? ? ? ? ? tmp
d????????? ? ? ? ? ? usr
d????????? ? ? ? ? ? var

Steps to Reproduce the Problem

  1. Downloaded the latest rootfs (rootfs.tar.xz) from https://sgp1lxdmirror01.do.letsbuildthe.cloud/images/ubuntu/jammy/amd64/cloud/
  2. Extract rootfs to directory and add local account by:
mkdir /home/capz/ubuntu
proot --link2symlink \
  tar -C /home/capz/ubuntu_new --warning=no-unknown-keyword \
  --delay-directory-restore --preserve-permissions \
  -xvf rootfs.tar.xz --exclude='dev'
proot -0 -b /dev -b /proc -b /sys -r /home/capz/ubuntu_new /bin/bash
addgroup --gid 200 capz
adduser --home /home/capz --shell /bin/bash --uid 640 capz --ingroup capz
exit
  1. proot with non-root user account and list files/directories:
proot -b /dev -b /proc -b /sys -r /home/justin/ubuntu_new /bin/bash
ls -lth /

Specifications

  • Proot/Care version: 5.4.0
  • Kernel version: 3.10.0-957.1.3.el7.x86_64
  • Host distribution: CentOS Linux 7.6.1810 (Core)
  • Guest distribution: Ubuntu 22.04.2 LTS

I should note that if I proot with arg -0 (root), everything looks fine, it is only when I proot as my non-root user account that I get the unknown file/directory attributes.

@Fierelier
Copy link

Fierelier commented Oct 2, 2023

Similar issue with Arch, but also when root in guest -- pacman fails to run. Folders are accessible with non-root user on host.

[root@B456A857 /]# pacman
error: failed to initialize alpm library:
(root: /, dbpath: /var/lib/pacman/)
could not find or read directory

[root@B456A857 /]# ls -l /var/lib/             
ls: cannot access '/var/lib/arpd': No such file or directory
ls: cannot access '/var/lib/krb5kdc': No such file or directory
ls: cannot access '/var/lib/pacman': No such file or directory
total 0
d????????? ? ?    ?      ?            ? arpd
d????????? ? ?    ?      ?            ? krb5kdc
drwxr-xr-x 1 root root   0 May 10 17:09 misc
d????????? ? ?    ?      ?            ? pacman
drwxr-xr-x 1 root root 114 Aug 26 11:16 systemd
  • Proot/Care version: 5.1.0
  • Kernel version: 6.1.0-11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux
  • Host distribution: Devuan 5.0 (amd64)
  • Guest distribution: Arch Linux (x86_64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants