From: Bhaskar Metiya Date: Wed, 14 Aug 2024 07:27:14 +0000 (+0530) Subject: apps/req.c: No warning reading from stdin if redirected X-Git-Tag: openssl-3.4.0-alpha1~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d2cbd9b5a126189d5e9bc78a3bdb9709427d02b;p=thirdparty%2Fopenssl.git apps/req.c: No warning reading from stdin if redirected CLA: trivial Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/25179) --- diff --git a/apps/req.c b/apps/req.c index 2d23861cf69..73dd94a5679 100644 --- a/apps/req.c +++ b/apps/req.c @@ -30,6 +30,7 @@ #ifndef OPENSSL_NO_DSA # include #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"); }