Behavior difference with file permissions between focal and jammy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
High
|
Unassigned |
Bug Description
With the maas 3.2 snap (core20-based) we noticed a difference in behavior when running on a focal and jammy (tested in containers).
The snap has the `home` plug. On focal (20.04 LTS), an app running as root can read root-owned files in other users' homes, while when running on jammy (22.04 LTS), that's not possible anymore:
# echo test > /home/ubuntu/
# echo test > /home/ubuntu/
# chown ubuntu.ubuntu /home/ubuntu/
# ls -l /home/ubuntu/
-rw-rw-r-- 1 ubuntu ubuntu 5 Jul 12 13:44 /home/ubuntu/
-rw-rw-r-- 1 root root 5 Jul 12 13:44 /home/ubuntu/
# snap install maas --channel=3.2
# focal host
root@f:~# snap run --shell maas -c 'cat /home/ubuntu/
cat: /home/ubuntu/
root@f:~# snap run --shell maas -c 'cat /home/ubuntu/
test
# jammy host
root@j:~# snap run --shell maas -c 'cat /home/ubuntu/
cat: /home/ubuntu/
root@j:~# snap run --shell maas -c 'cat /home/ubuntu/
cat: /home/ubuntu/
description: | updated |
Thanks for raising it.