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

Root directory and system-related files change ownership to the current user when the user changes #380

Open
LeiCraft opened this issue May 17, 2024 · 0 comments

Comments

@LeiCraft
Copy link

Expected Behavior

Ownership should not change

Actual Behavior

When switching to a non-root user, the ownership of almost all files and directories changes

Steps to Reproduce the Problem

  1. Download and install Proot
  2. Run proot -0 -rootfs "<path>" -b /dev -b /sys -b /proc
  3. add another user with useradd -s /bin/bash <username>
  4. Run sudo su <username> to change User
  5. Run ls -l / to see the issue

Specifications

  • Proot/Care version: v5.4.0
  • Kernel version: 5.10.0-29-cloud-amd64
  • Host distribution: Ubuntu 24.04
  • Guest distribution: Debian 11

Command Output

root@hostname:/# ls -l /
total 60
lrwxrwxrwx   1 root root    7 May 17 05:24 bin -> usr/bin
drwxr-xr-x   2 root root 4096 Jan 28 21:20 boot
drwxr-xr-x   5 root root  360 May 17 14:14 dev
drwxr-xr-x  53 root root 4096 May 17 12:27 etc
drwxr-xr-x   4 root root 4096 May 17 12:27 home
-rwxr-xr-x   1 root root 3163 May 17 12:25 install.sh
lrwxrwxrwx   1 root root    7 May 17 05:24 lib -> usr/lib
lrwxrwxrwx   1 root root    9 May 17 05:24 lib32 -> usr/lib32
lrwxrwxrwx   1 root root    9 May 17 05:24 lib64 -> usr/lib64
lrwxrwxrwx   1 root root   10 May 17 05:24 libx32 -> usr/libx32
drwxr-xr-x   2 root root 4096 May 17 05:24 media
drwxr-xr-x   2 root root 4096 May 17 05:24 mnt
drwxr-xr-x   2 root root 4096 May 17 05:24 opt
dr-xr-xr-x 166 root root    0 May 17 14:14 proc
drwx------   2 root root 4096 May 17 15:28 root
drwxr-xr-x   3 root root 4096 May 17 14:14 run
lrwxrwxrwx   1 root root    8 May 17 05:24 sbin -> usr/sbin
drwxr-xr-x   2 root root 4096 May 17 05:24 srv
dr-xr-xr-x  13 root root    0 May 17 14:14 sys
drwxr-xr-x   2 root root 4096 May 17 12:26 tmp
drwxr-xr-x  14 root root 4096 May 17 05:24 usr
drwxr-xr-x  11 root root 4096 May 17 05:24 var
root@hostname:/# su leicraft
leicraft@hostname:/$ ls -l /
total 60
lrwxrwxrwx   1 leicraft leicraft    7 May 17 05:24 bin -> usr/bin
drwxr-xr-x   2 leicraft leicraft 4096 Jan 28 21:20 boot
drwxr-xr-x   5 root     root      360 May 17 14:14 dev
drwxr-xr-x  53 leicraft leicraft 4096 May 17 12:27 etc
drwxr-xr-x   4 leicraft leicraft 4096 May 17 12:27 home
-rwxr-xr-x   1 leicraft leicraft 3163 May 17 12:25 install.sh
lrwxrwxrwx   1 leicraft leicraft    7 May 17 05:24 lib -> usr/lib
lrwxrwxrwx   1 leicraft leicraft    9 May 17 05:24 lib32 -> usr/lib32
lrwxrwxrwx   1 leicraft leicraft    9 May 17 05:24 lib64 -> usr/lib64
lrwxrwxrwx   1 leicraft leicraft   10 May 17 05:24 libx32 -> usr/libx32
drwxr-xr-x   2 leicraft leicraft 4096 May 17 05:24 media
drwxr-xr-x   2 leicraft leicraft 4096 May 17 05:24 mnt
drwxr-xr-x   2 leicraft leicraft 4096 May 17 05:24 opt
dr-xr-xr-x 168 root     root        0 May 17 14:14 proc
drwx------   2 leicraft leicraft 4096 May 17 15:28 root
drwxr-xr-x   3 leicraft leicraft 4096 May 17 14:14 run
lrwxrwxrwx   1 leicraft leicraft    8 May 17 05:24 sbin -> usr/sbin
drwxr-xr-x   2 leicraft leicraft 4096 May 17 05:24 srv
dr-xr-xr-x  13 root     root        0 May 17 14:14 sys
drwxr-xr-x   2 leicraft leicraft 4096 May 17 12:26 tmp
drwxr-xr-x  14 leicraft leicraft 4096 May 17 05:24 usr
drwxr-xr-x  11 leicraft leicraft 4096 May 17 05:24 var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant