Does any Unix-like system attribute a value to a SUID bit in a directory?

As the name says, any Unix-like system ascribes a value to a SUID bit in a directory , and if so, what does it mean?

The SVTX (saved text or sticky) bit makes sense - you should not delete a file from this directory if you cannot write it to a file. It is used, for example, for / tmp.

The SGID bit (set by the GID) has values ​​- the files created in this directory must belong to the group that owns the directory (although this assignment can later be changed by an explicit call to chown (2)).

What about SUID bits?

+3
source share
4 answers

Node, FreeBSD : mount (8):

             suiddir
                 A directory on the mounted file system will respond to
                 the SUID bit being set, by setting the owner of any new
                 files to be the same as the owner of the directory.  New
                 directories will inherit the bit from their parents.
                 Execute bits are removed from the file, and it will not
                 be given to root.

                 This feature is designed for use on fileservers serving
                 PC users via ftp, SAMBA, or netatalk.  It provides secu-
                 rity holes for shell users and as such should not be used
                 on shell machines, especially on home directories.  This
                 option requires the SUIDDIR option in the kernel to work.
                 Only UFS file systems support this option.  See chmod(2)
                 for more information.

man man chmod (2), suid:

           4000    (the setuid bit).  Executable files with this bit set will
               run with effective uid set to the uid of the file owner.
               Directories with this bit set will force all files and sub-
               directories created in them to be owned by the directory
               owner and not by the uid of the creating process, if the
               underlying file system supports this feature: see chmod(2)
               and the suiddir option to mount(8).

, , , , FreeBSD, , Linux , .

+6

:

, set-group-ID, , , set-group-ID . set-user-ID set-user-ID . , chmod chown .

set-user-ID set-group-ID. , chmod mkdir, , , . , chmod set-user-ID set-group-ID , .

+4

, , , SUID-, , . , , . ()

: Linux 2.6.25.5-1.1-default # 1 SMP x86_64 GNU/Linux openSUSE 11.0 (X86-64).

mkdir tmp
chmod 4777 tmp
su othergroup
touch testfile

.

+1

SUID , ( ) , , .

, "suid root", .

EDIT: ( , ) - ;-)

0

Source: https://habr.com/ru/post/1704465/


All Articles