Uppercase S in permissions of a folder

What does the letter S mean below? The file in question is a folder.

                                                                enter image description here

I read here that an upper-case S can represent that the setgid bit is active for a binary executable. But this is a folder. Does it still mean that the setgid bit is activated for it? If so, what does that mean?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

That means that any file dropped into the folder will take on the folder’s owning group.

For example: Suppose you have a folder called “shared” which belongs to user “intrpc” and group “users”, and you (as user “initrpc”) drop a file into it. As a result, the file will be belong to user “intrpc” and group “users”, regardless of “initrpc”‘s primary group.

On most systems, if a directory’s set-group-ID bit is set, newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set-group-ID bit of the parent directory.

You can read about it here.

Why is the letter uppercase (from the link you gave)?

setgid has no effect if the group does not have execute permissions.
setgid is represented with a lower-case “s” in the output of ls. In
cases where it has no effect it is represented with an upper-case “S”.

Method 2

The upper case S is because the directory does not have execute permissions for the group. In a way this indicates an “error”, as you are saying:

newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set-group-ID bit of the parent directory.

(source: https://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html)

However, you are denying permission for the group members to enter the directory.

Method 3

https://en.wikipedia.org/wiki/Setuid#When_set_on_a_directory

Setting the setgid permission on a directory (“chmod g+s”) causes new
files and subdirectories created within it to inherit its group ID,
rather than the primary group ID of the user who created the file (the
owner ID is never affected, only the group ID).

https://www.gnu.org/software/coreutils/manual/html_node/What-information-is-listed.html#What-information-is-listed

‘s’ If the set-user-ID or set-group-ID bit and the corresponding
executable bit are both set.

‘S’ If the set-user-ID or set-group-ID bit is set but the
corresponding executable bit is not set.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x