summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ssh.c b/ssh.c
index edf8f2c5e..1419f9874 100644
--- a/ssh.c
+++ b/ssh.c
@@ -71,6 +71,7 @@ RCSID("$OpenBSD: ssh.c,v 1.224 2004/07/28 09:40:29 markus Exp $");
71#include "match.h" 71#include "match.h"
72#include "msg.h" 72#include "msg.h"
73#include "monitor_fdpass.h" 73#include "monitor_fdpass.h"
74#include "uidswap.h"
74 75
75#ifdef SMARTCARD 76#ifdef SMARTCARD
76#include "scard.h" 77#include "scard.h"
@@ -644,8 +645,10 @@ again:
644 * user's home directory if it happens to be on a NFS volume where 645 * user's home directory if it happens to be on a NFS volume where
645 * root is mapped to nobody. 646 * root is mapped to nobody.
646 */ 647 */
647 seteuid(original_real_uid); 648 if (original_effective_uid == 0) {
648 setuid(original_real_uid); 649 PRIV_START;
650 permanently_set_uid(pw);
651 }
649 652
650 /* 653 /*
651 * Now that we are back to our own permissions, create ~/.ssh 654 * Now that we are back to our own permissions, create ~/.ssh