summaryrefslogtreecommitdiff
path: root/readpass.c
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 /readpass.c
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).
Diffstat (limited to 'readpass.c')
-rw-r--r--readpass.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/readpass.c b/readpass.c
index 4eeeed91..3724eeab 100644
--- a/readpass.c
+++ b/readpass.c
@@ -32,7 +32,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readpass.c,v 1.20 2001/07/02 22:29:20 markus Exp $");
+RCSID("$OpenBSD: readpass.c,v 1.21 2001/07/10 21:49:12 markus Exp $");
#include "xmalloc.h"
#include "readpass.h"
@@ -54,10 +54,14 @@ ssh_askpass(char *askpass, const char *msg)
error("ssh_askpass: fflush: %s", strerror(errno));
if (askpass == NULL)
fatal("internal error: askpass undefined");
- if (pipe(p) < 0)
- fatal("ssh_askpass: pipe: %s", strerror(errno));
- if ((pid = fork()) < 0)
- fatal("ssh_askpass: fork: %s", strerror(errno));
+ if (pipe(p) < 0) {
+ error("ssh_askpass: pipe: %s", strerror(errno));
+ return xstrdup("");
+ }
+ if ((pid = fork()) < 0) {
+ error("ssh_askpass: fork: %s", strerror(errno));
+ return xstrdup("");
+ }
if (pid == 0) {
seteuid(getuid());
setuid(getuid());