summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-09-19 21:33:45 +0200
committerRichard Levitte <levitte@openssl.org>2018-09-20 06:39:07 +0200
commit276bf8620ce35a613c856f2b70348f65ffe94067 (patch)
treea2b1e48bb91f6340582301e764eef91de0836575 /crypto/ui
parentReset TLS 1.3 ciphers in SSL_CTX_set_ssl_version() (diff)
downloadopenssl-276bf8620ce35a613c856f2b70348f65ffe94067.tar.xz
openssl-276bf8620ce35a613c856f2b70348f65ffe94067.zip
crypto/ui/ui_openssl.c: make sure to recognise ENXIO and EIO too
These both indicate that the file descriptor we're trying to use as a terminal isn't, in fact, a terminal. Fixes #7271 Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7272)
Diffstat (limited to 'crypto/ui')
-rw-r--r--crypto/ui/ui_openssl.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 45d48202b5..6b996134df 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -415,6 +415,24 @@ static int open_console(UI *ui)
is_a_tty = 0;
else
# endif
+# ifdef ENXIO
+ /*
+ * Solaris can return ENXIO.
+ * This should be ok
+ */
+ if (errno == ENXIO)
+ is_a_tty = 0;
+ else
+# endif
+# ifdef EIO
+ /*
+ * Linux can return EIO.
+ * This should be ok
+ */
+ if (errno == EIO)
+ is_a_tty = 0;
+ else
+# endif
# ifdef ENODEV
/*
* MacOS X returns ENODEV (Operation not supported by device),