diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-08-15 23:14:49 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-08-15 23:14:49 +0000 |
commit | a66039373b81679d8af3ae6da347b1ebf0aedcc2 (patch) | |
tree | e0b9b64d1e00425f29f91bebdcf33249fb32ed95 /uidswap.c | |
parent | 79e93bca6f158ae7cc7a0f15a66091b0dabac057 (diff) |
- markus@cvs.openbsd.org 2001/08/08 18:20:15
[uidswap.c]
permanently_set_uid is a noop if user is not privilegued;
fixes bug on solaris; from sbi@uchicago.edu
Diffstat (limited to 'uidswap.c')
-rw-r--r-- | uidswap.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: uidswap.c,v 1.16 2001/04/20 16:32:22 markus Exp $"); | 15 | RCSID("$OpenBSD: uidswap.c,v 1.17 2001/08/08 18:20:15 markus Exp $"); |
16 | 16 | ||
17 | #include "log.h" | 17 | #include "log.h" |
18 | #include "uidswap.h" | 18 | #include "uidswap.h" |
@@ -145,6 +145,9 @@ restore_uid(void) | |||
145 | void | 145 | void |
146 | permanently_set_uid(struct passwd *pw) | 146 | permanently_set_uid(struct passwd *pw) |
147 | { | 147 | { |
148 | /* it's a no-op unless privileged */ | ||
149 | if (!privileged) | ||
150 | return; | ||
148 | if (temporarily_use_uid_effective) | 151 | if (temporarily_use_uid_effective) |
149 | fatal("restore_uid: temporarily_use_uid effective"); | 152 | fatal("restore_uid: temporarily_use_uid effective"); |
150 | if (setgid(pw->pw_gid) < 0) | 153 | if (setgid(pw->pw_gid) < 0) |