From: Maxim Zakharov <5158255+Maxime2@users.noreply.github.com> Date: Fri, 8 May 2020 04:58:10 +0000 (+1000) Subject: TTY_get() in crypto/ui/ui_openssl.c open_console() can also return errno 1 (EPERM... X-Git-Tag: openssl-3.0.0-alpha3~90 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fopenssl.git;a=commitdiff_plain;h=082394839ea32386abc7ee33aaa9da864287064c 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 Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11767) --- diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index cf873431f7..e41a719e65 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),