diff options
author | Damien Miller <djm@mindrot.org> | 2006-06-13 13:05:15 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2006-06-13 13:05:15 +1000 |
commit | 6b4069ad563ce578cbfa6f90e76b462d26483e67 (patch) | |
tree | 777206b388f2ef12b83275d4aeb78e96cdea1bdd /readpass.c | |
parent | eb13e556e58a52a3ff0c734a8690ad41686cf92c (diff) |
- markus@cvs.openbsd.org 2006/06/06 10:20:20
[readpass.c sshconnect.c sshconnect.h sshconnect2.c uidswap.c]
replace remaining setuid() calls with permanently_set_uid() and
check seteuid() return values; report Marcus Meissner; ok dtucker djm
Diffstat (limited to 'readpass.c')
-rw-r--r-- | readpass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/readpass.c b/readpass.c index c3d36a028..60e4a902f 100644 --- a/readpass.c +++ b/readpass.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readpass.c,v 1.37 2006/03/25 13:17:02 djm Exp $ */ | 1 | /* $OpenBSD: readpass.c,v 1.38 2006/06/06 10:20:20 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -37,6 +37,7 @@ | |||
37 | #include "pathnames.h" | 37 | #include "pathnames.h" |
38 | #include "log.h" | 38 | #include "log.h" |
39 | #include "ssh.h" | 39 | #include "ssh.h" |
40 | #include "uidswap.h" | ||
40 | 41 | ||
41 | static char * | 42 | static char * |
42 | ssh_askpass(char *askpass, const char *msg) | 43 | ssh_askpass(char *askpass, const char *msg) |
@@ -60,8 +61,7 @@ ssh_askpass(char *askpass, const char *msg) | |||
60 | return NULL; | 61 | return NULL; |
61 | } | 62 | } |
62 | if (pid == 0) { | 63 | if (pid == 0) { |
63 | seteuid(getuid()); | 64 | permanently_set_uid(getpwuid(getuid())); |
64 | setuid(getuid()); | ||
65 | close(p[0]); | 65 | close(p[0]); |
66 | if (dup2(p[1], STDOUT_FILENO) < 0) | 66 | if (dup2(p[1], STDOUT_FILENO) < 0) |
67 | fatal("ssh_askpass: dup2: %s", strerror(errno)); | 67 | fatal("ssh_askpass: dup2: %s", strerror(errno)); |