]> andersk Git - gssapi-openssh.git/blobdiff - openssh/readpass.c
Import of OpenSSH 4.2p1
[gssapi-openssh.git] / openssh / readpass.c
index c2bacdcd48ea9a5fb6a59f067cb238ffae009b15..7914799a4965ce37f23aca67ad5c12f9e20bbcd8 100644 (file)
@@ -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.33 2005/05/02 21:13:22 markus Exp $");
 
 #include "xmalloc.h"
 #include "misc.h"
@@ -106,15 +106,20 @@ 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);
                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)
This page took 0.031016 seconds and 4 git commands to generate.