summaryrefslogtreecommitdiff
path: root/readpass.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-05-26 12:05:28 +1000
committerDamien Miller <djm@mindrot.org>2005-05-26 12:05:28 +1000
commitddeb75294bed504a6182efa4b047e44363ba6eb7 (patch)
tree83e299fca6a4aaaa5897b4d6f17919b0e5cf76a1 /readpass.c
parentddee575b988e1f4858abfff0aca13d7ba016f2e4 (diff)
- 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@
Diffstat (limited to 'readpass.c')
-rw-r--r--readpass.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/readpass.c b/readpass.c
index c2bacdcd..a193d036 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)