TTY_get() in crypto/ui/ui_openssl.c open_console() can also return errno 1 (EPERM...
[openssl.git] / crypto / ui / ui_openssl.c
index cf873431f7a014a6d5fe464f707cb8874328174c..e41a719e65ef6119da2a630c2eb3e34940cec691 100644 (file)
@@ -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),