From 22a4066c496f2a1cb7fd9bd698da730301d05cdc Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Wed, 25 Jun 2025 17:33:16 +0200 Subject: [PATCH] Better lookup for openssl executable Fixes #27891 Reviewed-by: Tomas Mraz Reviewed-by: Neil Horman Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/27895) (cherry picked from commit fa0c67a28a5a7d6ebeae7cb14d036780485e2fcd) --- tools/c_rehash.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/c_rehash.in b/tools/c_rehash.in index 343cdc1e757..560acf659fc 100644 --- a/tools/c_rehash.in +++ b/tools/c_rehash.in @@ -63,10 +63,10 @@ if (defined(&Cwd::getcwd)) { my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; $ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); -if (! -x $openssl) { +if (!(-f $openssl && -x $openssl)) { my $found = 0; foreach (split /$path_delim/, $ENV{PATH}) { - if (-x "$_/$openssl") { + if (-f "$_/$openssl" && -x "$_/$openssl") { $found = 1; $openssl = "$_/$openssl"; last; @@ -88,7 +88,7 @@ if (@ARGV) { if (-d $dirlist[0]) { chdir $dirlist[0]; - $openssl="$pwd/$openssl" if (!-x $openssl); + $openssl="$pwd/$openssl" if (!(-f $openssl && -x $openssl)); chdir $pwd; } -- 2.47.2