| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.10

 

set_gid_user

#include "sfluid.h"
int
set_gid_user (void)

Synopsis

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 to the real user id. Use set gid root() to switch (back) to the 'root' gid. See also: set uid user() and set uid root().

Source Code - (sfluid.c)

{
#if (defined (DOES_UID))
#   if (defined (__UTYPE_HPUX))
    return (setgid (get_gid (REAL_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 (REAL_ID)));
#   endif
#else
    return (0);
#endif
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation