create a test directory in /mnt/user/Downloads
root@MediaStore:/mnt/user/Downloads# ls -al test
total 0
drwx------ 1 root root 0 Jan 20 23:33 ./
drwxrws--- 1 nobody users 205274 Jan 20 23:33 ../
root@MediaStore:/mnt/user/Downloads# ls -ld /mnt/{cache,user}/Downloads
drwxrws--- 1 nobody users 205274 Jan 20 23:33 /mnt/cache/Downloads/
drwxrws--- 1 nobody users 205274 Jan 20 23:33 /mnt/user/Downloads/
when this directory is mounted in a container like so
root@MediaStore:~# docker run --rm --name box -d -v /mnt/cache/Downloads:/media alpine sleep 3600
131ed3b6357ba8253513afc5e536361adf39de6ac5ca26ccdf22337770d60c76
root@MediaStore:~# docker exec -u 1002 -it box sh -c 'id; ls -ld /media; touch /media/a_file && ls -l /media/a_file'
uid=1002 gid=0(root)
drwxrws--- 1 99 users 205274 Jan 20 15:33 /media
touch: /media/a_file: Permission denied
root@MediaStore:~# docker stop box
box
root@MediaStore:~# docker run --rm --name box -d -v /mnt/user/Downloads:/media alpine sleep 3600
0dc76c0b4c8c6cf3f7b05c998a96e96a18e6f394e0e0bada60b66db3225c17c8
root@MediaStore:~# docker exec -u 1002 -it box sh -c 'id; ls -ld /media; touch /media/a_file && ls -l /media/a_file'
uid=1002 gid=0(root)
drwxrws--- 1 99 users 205274 Jan 20 15:33 /media
-rw-r--r-- 1 1002 root 0 Jan 20 15:40 /media/a_file
root@MediaStore:~# docker stop box
box
Seems like when the path is mounted via the user share path, the file permissions can be ignored in a specific situation
Edit:
It seems to be shfs itself - since the following issue occurs at the Unraid level
root@MediaStore:/mnt/user/Downloads# echo x > a
root@MediaStore:/mnt/user/Downloads# chmod 600 a
root@MediaStore:/mnt/user/Downloads# ls -l a
-rw------- 1 root root 2 Mar 23 21:44 a
root@MediaStore:/mnt/user/Downloads# ls -l /mnt/cache/Downloads/a
-rw------- 1 root root 2 Mar 23 21:44 /mnt/cache/Downloads/a
root@MediaStore:/mnt/user/Downloads# cat a
x
root@MediaStore:/mnt/user/Downloads# su nobody -s /bin/sh
nobody@MediaStore:/mnt/user/Downloads$ cat a
x
nobody@MediaStore:/mnt/user/Downloads$ cat /mnt/cache/Downloads/a
cat: /mnt/cache/Downloads/a: Permission denied
nobody@MediaStore:/mnt/user/Downloads$ echo y > a
nobody@MediaStore:/mnt/user/Downloads$ cat a
y
-
1
-
1
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.