aboutsummaryrefslogtreecommitdiff
path: root/crypto/ui/ui_openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ui/ui_openssl.c')
-rw-r--r--crypto/ui/ui_openssl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 168de4630dcc..9526c16536cb 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -439,6 +439,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),