c_rehash: Fix file extension matching
authorTobias Girstmair <tobias.girstmair@tirol.gv.at>
Tue, 18 Oct 2022 11:23:21 +0000 (13:23 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 20 Oct 2022 09:26:17 +0000 (11:26 +0200)
For some reason, parenthesis were added 8 years ago in commit
a787c2590e468585a1a19738e0c7f481ec91b762. This essentially removed the
\. and $ constructs from the middle branches. Hence a file called e.g.
cert.key would accidentally match the (cer) rule.

CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19427)

tools/c_rehash.in

index 343cdc1e7575e90d1298364be6f5c8dac50ed0db..4dd1b4468279f73506c5a0adc469acdc9d0ea748 100644 (file)
@@ -143,7 +143,7 @@ sub hash_dir {
             }
         }
     }
-    FILE: foreach $fname (grep {/\.(pem)|(crt)|(cer)|(crl)$/} @flist) {
+    FILE: foreach $fname (grep {/\.(pem|crt|cer|crl)$/} @flist) {
         # Check to see if certificates and/or CRLs present.
         my ($cert, $crl) = check_file($fname);
         if (!$cert && !$crl) {