summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-08-15 23:14:49 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-08-15 23:14:49 +0000
commita66039373b81679d8af3ae6da347b1ebf0aedcc2 (patch)
treee0b9b64d1e00425f29f91bebdcf33249fb32ed95 /uidswap.c
parent79e93bca6f158ae7cc7a0f15a66091b0dabac057 (diff)
downloadopenssh-git-a66039373b81679d8af3ae6da347b1ebf0aedcc2.tar.gz
- 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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/uidswap.c b/uidswap.c
index 941d6f19..32305a7d 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: uidswap.c,v 1.16 2001/04/20 16:32:22 markus Exp $");
+RCSID("$OpenBSD: uidswap.c,v 1.17 2001/08/08 18:20:15 markus Exp $");
#include "log.h"
#include "uidswap.h"
@@ -145,6 +145,9 @@ restore_uid(void)
void
permanently_set_uid(struct passwd *pw)
{
+ /* it's a no-op unless privileged */
+ if (!privileged)
+ return;
if (temporarily_use_uid_effective)
fatal("restore_uid: temporarily_use_uid effective");
if (setgid(pw->pw_gid) < 0)