AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  what are the functions of S and s bit in the file permission?

    Posted Wed August 02, 2006 11:27 PM

    Originally posted by: SystemAdmin


    Please help: what are the means of S and s bit in the file permission?

    drwx--S---
    drwxr-sr-x


  • 2.  Re: what are the functions of S and s bit in the file permission?

    Posted Thu August 03, 2006 03:18 PM

    Originally posted by: SystemAdmin


    Hi,

    if u have a file with

    rw-r-x--- /tmp/test123
    and u do chmod g+s /tmp/test123 then u would find
    rw-r-s--- /tmp/test123
    but if its
    rw-r----- /tmp/test123 and u issue the same comand then u wd find

    rw-r-S--- /tmp/test123

    The setuid bit allows u to run programs with the user or grp privleges for which it is set.

    For example it would have been not possible for a user to change his passwd, had the /bin/passwd binary had no setuid bits.

    Regards,
    PP BIJU KRISHNAN


  • 3.  Re: what are the functions of S and s bit in the file permission?

    Posted Thu August 03, 2006 08:45 PM

    Originally posted by: SystemAdmin


    Thanks.


  • 4.  Re: what are the functions of S and s bit in the file permission?

    Posted Tue August 22, 2006 10:20 PM

    Originally posted by: SystemAdmin


    s if the file is executible.
    S if not executible.

    Or is it the other way around, :-) Anyway, you get the idea.


  • 5.  Re: what are the functions of S and s bit in the file permission?



  • 6.  Re: what are the functions of S and s bit in the file permission?

    Posted Wed August 23, 2006 12:51 AM

    Originally posted by: SystemAdmin


    Well, why is it way off?

    If you set the s bit on an executible file, it shows up as rws
    If you set the s bitit bit on a non-executible file it shows up as rwS

    Is that not correct?


  • 7.  Re: what are the functions of S and s bit in the file permission?

    Posted Wed August 23, 2006 08:50 AM

    Originally posted by: SystemAdmin


    That is indeed correct. The relevant sentence from the ls man page says, and I quote:

    The indications of set-ID and 01000 bit of the mode are capitalized (S and T,
    respectively) if the corresponding execute permission is not set.


  • 8.  Yeah, but what do they DO?

    Posted Thu August 24, 2006 03:36 PM

    Originally posted by: SystemAdmin


    The set-user-ID and set-group-ID bits on executable file permissions cause the effective user and/or group ID of the newly executed program to be set to the file owner or file group value, depending on which specific bit has been set. This allows a program to temporarily execute with the permissions of the user and/or group which owns that file. For example, if user codebob[/code] owns file codemyFile[/code] and user codesue[/code] executes that file, the program begins execution with the permissions of codebob[/code] and not codesue[/code].

    When the set-group-ID bit is set on a directory, all files and directories created within that directory, recursively, will have the same group as the directory. In addition, subdirectories will also have the set-group-ID bit set.