summaryrefslogtreecommitdiffstats
path: root/secure/lib/libdes/read_pwd.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1996-08-10 17:19:16 +0000
committermarkm <markm@FreeBSD.org>1996-08-10 17:19:16 +0000
commit1070b2b72f12b0a1c6a601193f0f167b6a01bfd1 (patch)
tree2b546f9daf8ba085fc95a794185af043b7c49919 /secure/lib/libdes/read_pwd.c
parent9b57620710eb8677622acdaca23dd45010404927 (diff)
downloadFreeBSD-src-1070b2b72f12b0a1c6a601193f0f167b6a01bfd1.zip
FreeBSD-src-1070b2b72f12b0a1c6a601193f0f167b6a01bfd1.tar.gz
Next version from the author - from SSLeay.0.6.3
Diffstat (limited to 'secure/lib/libdes/read_pwd.c')
-rw-r--r--secure/lib/libdes/read_pwd.c14
1 files changed, 12 insertions, 2 deletions
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 <signal.h>
#include <string.h>
#include <setjmp.h>
+#include <errno.h>
/* 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
OpenPOWER on IntegriCloud