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