diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |