| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sfluid.h" int set_gid_root (void)
This function can be used by 'setgid' programs; i.e. programs that run under a fixed gid such as 'root'. Typically such programs need to access root resources, but user data files. To do this they must switch between the 'root' gid and the 'user' gid. This function switches back to the root user id. Use set gid user() to switch to the 'user' gid. See also: set gid user() and set gid root().
{ #if (defined (DOES_UID)) # if (defined (__UTYPE_HPUX) || defined (__UTYPE_BEOS)) return (setgid (get_gid (EFFECTIVE_ID))); # elif (defined (__OS2__)) /* OS/2 only supports one UID */ return (0); # elif (defined (__VMS__)) /* No setgid under OpenVMS */ return (0); # else return (setegid (get_gid (EFFECTIVE_ID))); # endif #else return (0); #endif }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |