]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/req.c: No warning reading from stdin if redirected
authorBhaskar Metiya <bhaskarmetiya@gmail.com>
Wed, 14 Aug 2024 07:27:14 +0000 (12:57 +0530)
committerRichard Levitte <levitte@openssl.org>
Thu, 15 Aug 2024 15:59:28 +0000 (17:59 +0200)
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25179)

apps/req.c

index 2d23861cf69878b8535c20d2a276cc6e0fa2fd3b..73dd94a567944a8b845e0953ac7a5e5d36e6d2cc 100644 (file)
@@ -30,6 +30,7 @@
 #ifndef OPENSSL_NO_DSA
 # include <openssl/dsa.h>
 #endif
+#include "internal/e_os.h"    /* For isatty() */
 
 #define BITS               "default_bits"
 #define KEYFILE            "default_keyfile"
@@ -516,7 +517,7 @@ int req_main(int argc, char **argv)
     if (infile == NULL) {
         if (gen_x509)
             newreq = 1;
-        else if (!newreq)
+        else if (!newreq && isatty(fileno_stdin()))
             BIO_printf(bio_err,
                        "Warning: Will read cert request from stdin since no -in option is given\n");
     }