Skip to content

Commit

Permalink
TTY_get() in crypto/ui/ui_openssl.c open_console() can also return er…
Browse files Browse the repository at this point in the history
…rno 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 #11767)
  • Loading branch information
Maxime2 authored and mattcaswell committed May 18, 2020
1 parent 88b15ed commit 0823948
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crypto/ui/ui_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 0823948

Please sign in to comment.