root cannot flock user file in rwt dir if parent gives limited access
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
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=
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
CasperMD5CheckR
DistroRelease: Ubuntu 20.04
InstallationDate: Installed on 2020-04-24 (4 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
IwConfig:
lo no wireless extensions.
ens33 no wireless extensions.
Lsusb:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 005: ID 0a89:0030 Aktiv Rutoken ECP
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Lsusb-t:
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
MachineType: VMware, Inc. VMware Virtual Platform
Package: linux (not installed)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcFB: 0 svgadrmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageV
linux-
linux-
linux-firmware 1.187
RfKill:
Tags: focal
Uname: Linux 5.4.0-26-generic x86_64
UnreportableReason: This report is about a package that is not installed.
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:
_MarkForUpload: False
dmi.bios.date: 07/29/2019
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: 6.00
dmi.board.name: 440BX Desktop Reference Platform
dmi.board.vendor: Intel Corporation
dmi.board.version: None
dmi.chassis.
dmi.chassis.type: 1
dmi.chassis.vendor: No Enclosure
dmi.chassis.
dmi.modalias: dmi:bvnPhoenixT
dmi.product.name: VMware Virtual Platform
dmi.product.
dmi.sys.vendor: VMware, Inc.
This applies to Ubuntu 20.04 only. No error in Ubuntu 16.04, Debian 10.