]> andersk Git - openssh.git/blobdiff - readpass.c
- (tim) [configure.ac] updwtmpx() on OpenServer seems to add duplicate entry.
[openssh.git] / readpass.c
index fc7629c37e6d3f51e8ad46aff2671bd66f81f371..eb4f6fdb6d903aa29b533e42b315b150a2f9a3ca 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: readpass.c,v 1.29 2004/05/08 00:21:31 djm Exp $");
+RCSID("$OpenBSD: readpass.c,v 1.30 2004/06/17 15:10:14 djm Exp $");
 
 #include "xmalloc.h"
 #include "misc.h"
@@ -103,7 +103,9 @@ read_passphrase(const char *prompt, int flags)
        int rppflags, use_askpass = 0, ttyfd;
 
        rppflags = (flags & RP_ECHO) ? RPP_ECHO_ON : RPP_ECHO_OFF;
-       if (flags & RP_ALLOW_STDIN) {
+       if (flags & RP_USE_ASKPASS)
+               use_askpass = 1;
+       else if (flags & RP_ALLOW_STDIN) {
                if (!isatty(STDIN_FILENO))
                        use_askpass = 1;
        } else {
@@ -115,6 +117,9 @@ read_passphrase(const char *prompt, int flags)
                        use_askpass = 1;
        }
 
+       if ((flags & RP_USE_ASKPASS) && getenv("DISPLAY") == NULL)
+               return (flags & RP_ALLOW_EOF) ? NULL : xstrdup("");
+
        if (use_askpass && getenv("DISPLAY")) {
                if (getenv(SSH_ASKPASS_ENV))
                        askpass = getenv(SSH_ASKPASS_ENV);
This page took 0.239567 seconds and 4 git commands to generate.