Good day everyone!
I am using Xubuntu 22.04 LTS.
Today I ran into a strange (for me) a problem. I created a directory owned by some group with sticky bit set. Then I created a text file as one member of this group, made its group the common group and permissions 664. Then I executed su to become another user and did the same with another file. Now, both users can read the files and both cannot delete the file they do not own, despite the write permission because of the sticky bit.
However, user A is UNABLE TO APPEND to the file created by user B, while the user B CAN append to the file created by user A. Permissions on the both files are identical and there seem to be no ACLs set for the files. Also, the user A has higher privileges system-wide, as can be seen from the group membership (but this should have no effect here).
The only other difference between the files is that one of these was actually created in user's directory and then cp'ed to this directory with sticky bit set. So the group was changed by cp (used without -p option). Still, where can this difference actually surface? I believe what ls -l shows is independent on the way I got there... or not?
So, how this weird situation is possible and how to get around it (in either way, so that the behaviour is consistent at least)?
Many thanks in advance.
