Score:0

User unable to access files in a folder with SUID S bit set

us flag

I have a folder which I want to share with users of a group named frx. I had applied chmod g+s to the folder, but for some reason the SUID bit (for folders in the /home/frx directory) came out as S instead.

> pwd
/home/frx

> ls -al
drwxrws---+  14 ferc frx    4096 Dec 24 23:20 .
drwxr-xr-x    8 root root   4096 Dec  2 12:48 ..
... 
drwxrwS---+  20 pi   frx    4096 Dec 19 18:50 views

From what I read, s and S shouldn't be any different if a user is just opening a file. However, another user in the group frx is unable to view or access files in the views directory, even though there are read/write permissions for the group. (He could touch files in /home/frx without problem.) Why is this happening?

How do I change the SUID bit to s for a directory?

Score:1
fr flag

To access files in a directory, the user must be granted execute permission on that directory.

S (uppercase s) indicates that the sticky bit is set for a group but execute bit - is not. And this is why another user from frx group cannot access any files in the views directory. You must set both group sticky and execute bits for this to work properly.

Old Geezer avatar
us flag
This is new to me. Wonder under what scenarios would a directory require `rw` but not `x`?
fr flag
`r` alone allows directory listing. I am not sure if `w` alone would work (I can imagine it allows hardlinking to existing file). `x` alone allows opening a file in a directory if you know its exact name, `wx` would also allow creating a file.
Old Geezer avatar
us flag
I had `rwS` for the group, and a group member couldn't see the directory listing. It was just ????????. Couldn't read a file. Couldn't overwrite a file either.
fr flag
Yes, it was just that.
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.