From 4522e130c87c341342c640bba970f4b89755f1cb Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 24 Apr 2018 14:31:32 +0200 Subject: [PATCH] apps/opt.c: Remove the access checks of input and output files open() will take care of the checks anyway Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/6033) --- apps/opt.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/opt.c b/apps/opt.c index 4d06983241..cc1418449e 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -682,20 +682,10 @@ int opt_next(void) return -1; case '<': /* Input file. */ - if (strcmp(arg, "-") == 0 || app_access(arg, R_OK) == 0) - break; - BIO_printf(bio_err, - "%s: Cannot open input file %s, %s\n", - prog, arg, strerror(errno)); - return -1; + break; case '>': /* Output file. */ - if (strcmp(arg, "-") == 0 || app_access(arg, W_OK) == 0 || errno == ENOENT) - break; - BIO_printf(bio_err, - "%s: Cannot open output file %s, %s\n", - prog, arg, strerror(errno)); - return -1; + break; case 'p': case 'n': if (!opt_int(arg, &ival) -- 2.34.1