From ddeb75294bed504a6182efa4b047e44363ba6eb7 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 26 May 2005 12:05:28 +1000 Subject: - dtucker@cvs.openbsd.org 2005/04/23 23:43:47 [readpass.c] Add debug message if read_passphrase can't open /dev/tty; bz #471; ok djm@ --- readpass.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'readpass.c') diff --git a/readpass.c b/readpass.c index c2bacdcd4..a193d0368 100644 --- a/readpass.c +++ b/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 "xmalloc.h" #include "misc.h" @@ -107,14 +107,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) -- cgit v1.2.3 From d2ebd450f035e2bc549d778389313441a433b173 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 26 May 2005 12:07:47 +1000 Subject: - markus@cvs.openbsd.org 2005/05/02 21:13:22 [readpass.c] missing {} --- ChangeLog | 5 ++++- readpass.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'readpass.c') diff --git a/ChangeLog b/ChangeLog index e1ef7a5e5..3a21b12d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,9 @@ - moritz@cvs.openbsd.org 2005/04/28 10:17:56 [progressmeter.c ssh-keyscan.c] add snprintf checks. ok djm@ markus@ + - markus@cvs.openbsd.org 2005/05/02 21:13:22 + [readpass.c] + missing {} 20050524 - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] @@ -2543,4 +2546,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3773 2005/05/26 02:07:32 djm Exp $ +$Id: ChangeLog,v 1.3774 2005/05/26 02:07:47 djm Exp $ diff --git a/readpass.c b/readpass.c index a193d0368..7914799a4 100644 --- a/readpass.c +++ b/readpass.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readpass.c,v 1.32 2005/04/23 23:43:47 dtucker Exp $"); +RCSID("$OpenBSD: readpass.c,v 1.33 2005/05/02 21:13:22 markus Exp $"); #include "xmalloc.h" #include "misc.h" @@ -106,9 +106,10 @@ read_passphrase(const char *prompt, int flags) if (flags & RP_USE_ASKPASS) use_askpass = 1; else if (flags & RP_ALLOW_STDIN) { - if (!isatty(STDIN_FILENO)) + 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); -- cgit v1.2.3