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

 

set_uid_root

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

Synopsis

This function can be used by 'setuid' programs; i.e. programs that run under a fixed uid such as 'root'. Typically such programs need to access root resources, but user data files. To do this they must switch between the 'root' uid and the 'user' uid. This function switches back to the root user id. Use set uid user() to switch to the 'user' uid. See also: set gid user() and set gid root().

Source Code - (sfluid.c)

{
#if (defined (DOES_UID))
#   if (defined (__UTYPE_HPUX) || defined (__UTYPE_BEOS))
    return (setuid (get_uid (EFFECTIVE_ID)));
#   elif (defined (__OS2__))            /*  OS/2 only supports one UID       */
    return (0);
#   elif (defined (__VMS__))            /*  No setuid under OpenVMS          */
    return (0);
#   else
    return (seteuid (get_uid (EFFECTIVE_ID)));
#   endif
#else
    return (0);
#endif
}

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