source: trunk/third/sysinfo/setreuid.c @ 12269

Revision 12269, 705 bytes checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12268, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * Copyright (c) 1992-1998 Michael A. Cooper.
3 * This software may be freely used and distributed provided it is not
4 * sold for profit or used in part or in whole for commercial gain
5 * without prior written agreement, and the author is credited
6 * appropriately.
7 */
8
9#ifndef lint
10static char *RCSid = "$Revision: 1.1.1.2 $";
11#endif
12
13/*
14 * Things related to running system commands.
15 */
16
17#include "defs.h"
18
19/*
20 * Set real and effective user ID.
21 */
22int setreuid(RealUID, EffectUID)
23    uid_t                       RealUID;
24    uid_t                       EffectUID;
25{
26    if (RealUID != (uid_t) -1)
27        if (setuid(RealUID) < 0)
28            return(-1);
29
30    if (EffectUID != (uid_t) -1)
31        if (seteuid(EffectUID) < 0)
32            return(-1);
33
34    return(0);
35}
Note: See TracBrowser for help on using the repository browser.