Skip to contentSkip to conversation

remove bogus file check on --genkey argument

PATCH In review Antonio Quartulli 3 participants 3 messages Apr 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove bogus file check on --genkey argument

When invoking openvpn as standalone with the --genkey argument, options_postprocess() is not called at all because do_genkey() takes over the execution earlier.

For this reason, checking the --genkey argument in options_postprocess_filechecks() is a no-op.

Geti rid of the bogus check altogether.

---
 src/openvpn/options.c | 3 ---
 1 file changed, 3 deletions(-)
src/openvpn/options.c +0 -3
index 63dc53c3..a8394c6c 100644
@@ -3420,9 +3420,6 @@ options_postprocess_filechecks(struct options *options)
                                   "--tls-crypt-v2");
     }
 
-    errs |= check_file_access(CHKACC_FILE|CHKACC_INLINE|CHKACC_PRIVATE,
-                              options->genkey_filename, R_OK,
-                              "--genkey");
     errs |= check_file_access(CHKACC_FILE|CHKACC_INLINE|CHKACC_PRIVATE,
                               options->shared_secret_file, R_OK, "--secret");
 
Signature · 1 line
2.26.1
Acked-by on v1 1/1
#1 lore raw

"If you say so" :-) (haven't looked more closely than "it compiles and does not introduce/modify possibly dangerous code paths").

Your patch has been applied to the master branch.

commit c40679fbb051228f6c5108adaa9f6fc6929b1e0f (master)

Author: Antonio Quartulli
Date:   Mon Apr 20 12:21:02 2020 +0200
     remove bogus file check on --genkey argument

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg19795.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

Acked-by on v1 1/1
#2 lore raw
In reply to Antonio Quartulli

Am 20.04.20 um 12:21 schrieb Antonio Quartulli:

Quoted 8 lines

When invoking openvpn as standalone with the --genkey argument, options_postprocess() is not called at all because do_genkey() takes over the execution earlier.

For this reason, checking the --genkey argument in options_postprocess_filechecks() is a no-op.

Geti rid of the bogus check altogether.

Typo!