diff options
author | Maxim Zakharov <5158255+Maxime2@users.noreply.github.com> | 2020-05-08 14:58:10 +1000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-05-18 09:56:27 +0100 |
commit | 082394839ea32386abc7ee33aaa9da864287064c (patch) | |
tree | 7f82105efad6d3d8976ff3f4df79245cf6b819ec | |
parent | 88b15ed9a54c591c3962149560d4f851322a54c4 (diff) | |
download | openssl-082394839ea32386abc7ee33aaa9da864287064c.zip openssl-082394839ea32386abc7ee33aaa9da864287064c.tar.gz openssl-082394839ea32386abc7ee33aaa9da864287064c.tar.bz2 |
TTY_get() in crypto/ui/ui_openssl.c open_console() can also return errno 1 (EPERM, Linux)
Signed-off-by: Maxim Zakharov <5158255+Maxime2@users.noreply.github.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11767)
-rw-r--r-- | crypto/ui/ui_openssl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index cf87343..e41a719 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -435,6 +435,16 @@ static int open_console(UI *ui) is_a_tty = 0; else # endif +# ifdef EPERM + /* + * Linux can return EPERM (Operation not permitted), + * e.g. if a daemon executes openssl via fork()+execve() + * This should be ok + */ + if (errno == EPERM) + is_a_tty = 0; + else +# endif # ifdef ENODEV /* * MacOS X returns ENODEV (Operation not supported by device), |