Score:0

Sticky bit denies appending for one user, allows for another one

jp flag

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.

Screenshot from the terminal

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.