You have been subscribed to a public bug:

1. create folder by root
2. add wt permission flags to all in that folder
3. flock a file by user in that folder - success
4. flock the same file by root - error: Permission denied
It is somehow important that user have limited access to parent folder (/ in 
this example).

test@ubuntu20-04:~$ sudo rm -rf /t_rwt/
test@ubuntu20-04:~$ sudo mkdir /t_rwt
test@ubuntu20-04:~$ sudo chmod a+wt /t_rwt
test@ubuntu20-04:~$ flock /t_rwt/file echo aaa
aaa
test@ubuntu20-04:~$ sudo flock /t_rwt/file echo aaa
flock: cannot open lock file /t_rwt/file: Permission denied
test@ubuntu20-04:~$ ls -las /t_rwt
total 8
4 drwxrwxrwt  2 root root 4096 Apr 28 08:01 .
4 drwxr-xr-x 26 root root 4096 Apr 28 08:00 ..
0 -rw-rw-r--  1 test test    0 Apr 28 08:01 file
test@ubuntu20-04:~$ id
uid=1000(test) gid=1000(test) 
groups=1000(test),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare)

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: bot-comment focal
-- 
root cannot flock user file in rwt dir if parent gives limited access
https://bugs.launchpad.net/bugs/1875667
You received this bug notification because you are a member of Kernel Packages, 
which is subscribed to linux in Ubuntu.

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to