issetugid man page on OpenIndiana

Man page or keyword search:  
man Server   20441 pages
apropos Keyword Search (all sections)
Output format
OpenIndiana logo
[printable version]

issetugid(2)			 System Calls			  issetugid(2)

NAME
       issetugid - determine if current executable is running setuid or setgid

SYNOPSIS
       #include <unistd.h>

       int issetugid(void);

DESCRIPTION
       The  issetugid()	 function  enables  library  functions (in libtermlib,
       libc, or other libraries) to  guarantee	safe  behavior	when  used  in
       setuid  or  setgid  programs  or programs that run with more privileges
       after a succesful exec(2).  Some	 library  functions  might  be	passed
       insufficient  information  and not know whether the current program was
       started setuid or setgid because a higher level calling code might have
       made  changes  to  the uid, euid, gid, or egid. These low-level library
       functions are therefore unable to determine if they are being run  with
       elevated or normal privileges.

       The  issetugid()	 function  should  be used to determine if a path name
       returned from a getenv(3C) call can be used safely to open  the	speci‐
       fied  file. It is often not safe to open such a file because the status
       of the effective uid is not known.

       The result of a call to issetugid() is unaffected by calls to setuid(),
       setgid(), or other such calls.  In case of a call to fork(2), the child
       process inherits the same status.

       The status of issetugid() is affected only by execve()  (see  exec(2)).
       If  a  child  process executes a new executable file, a new issetugid()
       status will be based on the existing process's uid, euid, gid, and egid
       permissions  and	 on  the modes of the executable file. If the new exe‐
       cutable file modes are setuid or setgid, or if the existing process  is
       executing the new image with uid != euid or gid != egid, or if the per‐
       mitted set before the call to the exec function is not  a  superset  of
       the  inheritable	 set  at  that	time, issetugid() returns 1 in the new
       process.

RETURN VALUES
       The issetugid() function returns 1 if the process was  made  setuid  or
       setgid as the result of the last or a previous call to execve(). Other‐
       wise it returns 0.

ERRORS
       The issetugid() function is  always  successful.	 No  return  value  is
       reserved to indicate an error.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Committed			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │MT-Level		     │Async-Signal-Safe		   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       exec(2), fork(2), setuid(2), getenv(3C), attributes(5), privileges(5)

SunOS 5.11			  19 Feb 2003			  issetugid(2)
[top]

List of man pages available for OpenIndiana

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net