summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-08-08 18:20:16 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-08-08 18:20:16 +0000
commit2d1f3f125a165ff56121fdec1883b19426eafc0d (patch)
treefed3de245f148e30a55ee5f3d6c8473f61e4dc07 /usr.bin
parent6c40984911941a612adf11cedf4b7dbadd513ac9 (diff)
permanently_set_uid is a noop if user is not privilegued;
fixes bug on solaris; from sbi@uchicago.edu
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/uidswap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/uidswap.c b/usr.bin/ssh/uidswap.c
index 39952e2b0fc..777d73c4bee 100644
--- a/usr.bin/ssh/uidswap.c
+++ b/usr.bin/ssh/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"
@@ -109,6 +109,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)