diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2005-04-23 23:43:48 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2005-04-23 23:43:48 +0000 |
commit | 5b72d47b6463dd79a531a5883f0292ab17a9fb59 (patch) | |
tree | 76e354d783a4112ecfb68a17556a03ad3313c2a6 /usr.bin/ssh | |
parent | fcfdb621e2a275b1dc497f8a4a15b2004cda1018 (diff) |
Add debug message if read_passphrase can't open /dev/tty; bz #471; ok djm@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/readpass.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/readpass.c b/usr.bin/ssh/readpass.c index 29e9342adcd..45a84bcabfe 100644 --- a/usr.bin/ssh/readpass.c +++ b/usr.bin/ssh/readpass.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readpass.c,v 1.31 2004/10/29 22:53:56 djm Exp $"); +RCSID("$OpenBSD: readpass.c,v 1.32 2005/04/23 23:43:47 dtucker Exp $"); #include <readpassphrase.h> @@ -109,14 +109,18 @@ read_passphrase(const char *prompt, int flags) use_askpass = 1; else if (flags & RP_ALLOW_STDIN) { if (!isatty(STDIN_FILENO)) + debug("read_passphrase: stdin is not a tty"); use_askpass = 1; } else { rppflags |= RPP_REQUIRE_TTY; ttyfd = open(_PATH_TTY, O_RDWR); if (ttyfd >= 0) close(ttyfd); - else + else { + debug("read_passphrase: can't open %s: %s", _PATH_TTY, + strerror(errno)); use_askpass = 1; + } } if ((flags & RP_USE_ASKPASS) && getenv("DISPLAY") == NULL) |