AIX

AIX

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


#Power
#Power
#Operatingsystems
#Servers
 View Only
  • 1.  Why do apps use the SGID bit on a non-executable?

    Posted 11/30/10 04:39 PM

    Originally posted by: SystemAdmin


    Hi,

    Maybe someone knows the answer to this, but I was unable to find a reason for it in the manuals. I have been checking for SUID and SGID programs and have found a number of log and lock files with the SGID bit set. I cannot think of a reason for this action; what can you suggest?

    For example, here are two files that I found:

    -rw-rwSrw- 1 chahy staff 0 Dec 1 00:05 /exe_suppe3/log/chahy.log

    ----r-sr-- 1 root system 0 Nov 17 14:33 Spmi.lock

    Regards,
    George
    #AIX-Forum


  • 2.  Re: Why do apps use the SGID bit on a non-executable?

    Posted 11/30/10 10:47 PM

    Originally posted by: Srikrishan


    Hi,

    SGID bit is used for mandatory locking(see man page of fcntl for details).

    In some cases one want to have exclusive access to a part(or whole) of file he can either use advisory locking where each process has to check and get a lock before doing an operation on a file but the process can also skip the checking/locking part and directly write to the file.

    OR

    he can use mandatory locking where no other process can do conflicting operations on a file, for mandatory locking that SGID bit should be set for a file(in addition to other requirements mentioned in the man page)

    Thanks
    Sri
    #AIX-Forum


  • 3.  Re: Why do apps use the SGID bit on a non-executable?

    Posted 12/02/10 07:22 PM

    Originally posted by: SystemAdmin


    Hi Sri,

    Many thanks for your assistance. I had trouble finding an AIX man page for fcntl, but there was plenty of material on the web. I couldn't get the locking to work from the shell; but that is probably not its intended use.

    Thanks again,
    George
    #AIX-Forum


  • 4.  Re: Why do apps use the SGID bit on a non-executable?

    Posted 12/02/10 10:26 PM