diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-08-15 17:23:34 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-08-15 17:23:34 +1000 |
commit | 25f60a7ee780c2cd4a01e05698149d274821012f (patch) | |
tree | 2fbe10fb72d4e1037dbadf1196dfba4062de299d /ssh.c | |
parent | 397a2f2612901785d8290a90ae9aa59efb422c92 (diff) |
- (dtucker) [Makefile.in ssh-keysign.c ssh.c] Use permanently_set_uid() since
it does the right thing on all platforms. ok djm@
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 |