-1

I am trying to understand why the file -b command is returning a certain value(s) when the sticky bit is set.

When I run file -b <dir> where dir has its group set to g+wrs, file -b returns setgid directory. Is this an expected output and how can I make it so it does not return setgid even on sticky bit directories?

To add more information it appears that this is happening to all directories that have their sticky bit set for the group.

Additionally, yes I have read the man page.

  • 1
    how can I make it so it does not return setgid even on sticky bit directories? – What's the point? XY problem maybe? To tell if some path leads to a directory check the exit status of test -d /the/path. – Kamil Maciorowski Apr 12 at 4:14
1

The 's' bit for user (04000) is setuid.

The 's' bit for group (02000) is setgid.

The 't' bit _for other (01000) is sticky.

You set the 's' bit for group which is setgid and is not sticky.

To set the sticky bit set o+t or something including that as a subset.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.