[readpass.c]
     Add debug message if read_passphrase can't open /dev/tty; bz #471;
     ok djm@
This commit is contained in:
Damien Miller 2005-05-26 12:05:28 +10:00
parent ddee575b98
commit ddeb75294b
2 changed files with 11 additions and 3 deletions

View File

@ -31,6 +31,10 @@
[ssh.c]
don't allocate a pty when -n flag (/dev/null stdin) is set, patch from
ignasi.roca AT fujitsu-siemens.com (bz #829); ok dtucker@
- 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@
20050524
- (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
@ -2530,4 +2534,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.3769 2005/05/26 02:05:05 djm Exp $
$Id: ChangeLog,v 1.3770 2005/05/26 02:05:28 djm Exp $

View 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.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)