From 1070b2b72f12b0a1c6a601193f0f167b6a01bfd1 Mon Sep 17 00:00:00 2001 From: markm Date: Sat, 10 Aug 1996 17:19:16 +0000 Subject: Next version from the author - from SSLeay.0.6.3 --- secure/lib/libdes/read_pwd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'secure/lib/libdes/read_pwd.c') diff --git a/secure/lib/libdes/read_pwd.c b/secure/lib/libdes/read_pwd.c index 47cb95f..240aa16 100644 --- a/secure/lib/libdes/read_pwd.c +++ b/secure/lib/libdes/read_pwd.c @@ -56,6 +56,7 @@ #include #include #include +#include /* There are 5 types of terminal interface supported, * TERMIO, TERMIOS, VMS, MSDOS and SGTTY @@ -238,6 +239,8 @@ int verify; int number=5; int ok=0; int ps=0; + int is_a_tty=1; + FILE *tty=NULL; char *p; @@ -251,7 +254,14 @@ int verify; #if defined(TTY_get) && !defined(VMS) if (TTY_get(fileno(tty),&tty_orig) == -1) - return(-1); + { +#ifdef ENOTTY + if (errno == ENOTTY) + is_a_tty=0; + else +#endif + return(-1); + } memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig)); #endif #ifdef VMS @@ -276,7 +286,7 @@ int verify; #endif #if defined(TTY_set) && !defined(VMS) - if (TTY_set(fileno(tty),&tty_new) == -1) + if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1)) return(-1); #endif #ifdef VMS -- cgit v1.1