Merge conflicts.

This commit is contained in:
christos 2005-02-13 06:01:14 +00:00
parent 8b8ab8547b
commit 43dbbb7ed8

View File

@ -1,4 +1,4 @@
/* $NetBSD: readpass.c,v 1.12 2003/07/10 01:09:46 lukem Exp $ */ /* $NetBSD: readpass.c,v 1.13 2005/02/13 06:01:14 christos Exp $ */
/* /*
* Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Markus Friedl. All rights reserved.
* *
@ -24,13 +24,13 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: readpass.c,v 1.28 2003/01/23 13:50:27 markus Exp $"); RCSID("$OpenBSD: readpass.c,v 1.30 2004/06/17 15:10:14 djm Exp $");
__RCSID("$NetBSD: readpass.c,v 1.12 2003/07/10 01:09:46 lukem Exp $"); __RCSID("$NetBSD: readpass.c,v 1.13 2005/02/13 06:01:14 christos Exp $");
#include <readpassphrase.h> #include <readpassphrase.h>
#include "xmalloc.h" #include "xmalloc.h"
#include "readpass.h" #include "misc.h"
#include "pathnames.h" #include "pathnames.h"
#include "log.h" #include "log.h"
#include "ssh.h" #include "ssh.h"
@ -107,7 +107,9 @@ read_passphrase(const char *prompt, int flags)
int rppflags, use_askpass = 0, ttyfd; int rppflags, use_askpass = 0, ttyfd;
rppflags = (flags & RP_ECHO) ? RPP_ECHO_ON : RPP_ECHO_OFF; 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)) if (!isatty(STDIN_FILENO))
use_askpass = 1; use_askpass = 1;
} else { } else {
@ -119,6 +121,9 @@ read_passphrase(const char *prompt, int flags)
use_askpass = 1; use_askpass = 1;
} }
if ((flags & RP_USE_ASKPASS) && getenv("DISPLAY") == NULL)
return (flags & RP_ALLOW_EOF) ? NULL : xstrdup("");
if (use_askpass && getenv("DISPLAY")) { if (use_askpass && getenv("DISPLAY")) {
if (getenv(SSH_ASKPASS_ENV)) if (getenv(SSH_ASKPASS_ENV))
askpass = getenv(SSH_ASKPASS_ENV); askpass = getenv(SSH_ASKPASS_ENV);