summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-07-14 12:19:56 +1000
committerDamien Miller <djm@mindrot.org>2001-07-14 12:19:56 +1000
commit07ab49ef71a627452bcb14f62bdb08c0cc9ee49e (patch)
treeb24034df87bbd68a4e0b194310ede802cbb59fd9
parentefb1edfc7fb393b8de2f50efa77c006f3bfe5394 (diff)
- markus@cvs.openbsd.org 2001/07/10 21:49:12
[readpass.c] don't panic if fork or pipe fail (just return an empty passwd).
-rw-r--r--ChangeLog5
-rw-r--r--readpass.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 9376129e1..866903664 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,9 @@
31 - deraadt@cvs.openbsd.org 2001/07/09 07:04:53 31 - deraadt@cvs.openbsd.org 2001/07/09 07:04:53
32 [session.c sftp-int.c] 32 [session.c sftp-int.c]
33 correct type on last arg to execl(); nordin@cse.ogi.edu 33 correct type on last arg to execl(); nordin@cse.ogi.edu
34 - markus@cvs.openbsd.org 2001/07/10 21:49:12
35 [readpass.c]
36 don't panic if fork or pipe fail (just return an empty passwd).
34 37
3520010711 3820010711
36 - (djm) dirname(3) may modify its argument on glibc and other systems. 39 - (djm) dirname(3) may modify its argument on glibc and other systems.
@@ -6006,4 +6009,4 @@
6006 - Wrote replacements for strlcpy and mkdtemp 6009 - Wrote replacements for strlcpy and mkdtemp
6007 - Released 1.0pre1 6010 - Released 1.0pre1
6008 6011
6009$Id: ChangeLog,v 1.1394 2001/07/14 02:19:36 djm Exp $ 6012$Id: ChangeLog,v 1.1395 2001/07/14 02:19:56 djm Exp $
diff --git a/readpass.c b/readpass.c
index 4eeeed917..3724eeab1 100644
--- a/readpass.c
+++ b/readpass.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#include "includes.h" 34#include "includes.h"
35RCSID("$OpenBSD: readpass.c,v 1.20 2001/07/02 22:29:20 markus Exp $"); 35RCSID("$OpenBSD: readpass.c,v 1.21 2001/07/10 21:49:12 markus Exp $");
36 36
37#include "xmalloc.h" 37#include "xmalloc.h"
38#include "readpass.h" 38#include "readpass.h"
@@ -54,10 +54,14 @@ ssh_askpass(char *askpass, const char *msg)
54 error("ssh_askpass: fflush: %s", strerror(errno)); 54 error("ssh_askpass: fflush: %s", strerror(errno));
55 if (askpass == NULL) 55 if (askpass == NULL)
56 fatal("internal error: askpass undefined"); 56 fatal("internal error: askpass undefined");
57 if (pipe(p) < 0) 57 if (pipe(p) < 0) {
58 fatal("ssh_askpass: pipe: %s", strerror(errno)); 58 error("ssh_askpass: pipe: %s", strerror(errno));
59 if ((pid = fork()) < 0) 59 return xstrdup("");
60 fatal("ssh_askpass: fork: %s", strerror(errno)); 60 }
61 if ((pid = fork()) < 0) {
62 error("ssh_askpass: fork: %s", strerror(errno));
63 return xstrdup("");
64 }
61 if (pid == 0) { 65 if (pid == 0) {
62 seteuid(getuid()); 66 seteuid(getuid());
63 setuid(getuid()); 67 setuid(getuid());