Bug 36312 - User belonging to another Group has no access when chmod 0040
Summary: User belonging to another Group has no access when chmod 0040
Status: RESOLVED INVALID
Alias: None
Product: File System
Classification: Unclassified
Component: ext4 (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Jan Kara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 00:19 UTC by ubuntuefnet
Modified: 2011-05-31 18:43 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.39
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description ubuntuefnet 2011-05-31 00:19:18 UTC
This may not be a bug, this may be intentional - however it was considered pretty damn weird when encountered and worth a mention.

Say we have user 'bob', he is the owner of file 'accounting.txt' and 'accounting.txt' has group 'staff' attributed to the file which 'bob' is a part of. If the permissions for the file only have group perms (e.g 0060), 'bob' will not be able to access 'accounting.txt', however all other users in the 'staff' group will have access.

Replication via CLI:

touch myfile.txt && chown `whoami`:`groups | awk '{print $2}'` myfile.txt && chmod 0040 myfile.txt && cat myfile.txt

System: Debian 6.0.1
Arch: x86_64
Kernel: 2.6.39
Comment 1 Jan Kara 2011-05-31 18:43:43 UTC
Yes, this works as defined in the standard. If user is the owner, we check against owner bits. If the user is not the owner, but belongs to the owner group, we check against group bits. If user falls into neither of previous cathegories, we use 'other' bits.

Note You need to log in before you can comment on or make changes to this bug.