]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Prefer openssl binary from --with-ssl-dir directory.
authorDarren Tucker <dtucker@dtucker.net>
Thu, 7 Mar 2024 06:18:14 +0000 (17:18 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 7 Mar 2024 08:25:17 +0000 (19:25 +1100)
Use openssl in the directory specified by --with-ssl-dir as long
as it's functional.  Reported by The Doctor.

configure.ac

index c1af4b42329b35b423c844e459671beeff6957c8..82e8bb7c14103535b8cfa8a5899f238dc498b6d1 100644 (file)
@@ -2743,7 +2743,15 @@ AC_ARG_WITH([ssl-dir],
                        else
                                CPPFLAGS="-I${withval} ${CPPFLAGS}"
                        fi
-                       openssl_bin_PATH="${PATH}${PATH_SEPARATOR}${withval}/bin${PATH_SEPARATOR}${withval}/apps"
+                       dnl Ensure specified openssl binary works, eg it can
+                       dnl find its runtime libraries, before trying to use.
+                       if test -x "${withval}/bin/openssl" && \
+                           "${withval}/bin/openssl" version >/dev/null 2>&1; then
+                               openssl_bin_PATH="${withval}/bin${PATH_SEPARATOR}${PATH}"
+                       elif test -x "${withval}/apps/openssl" && \
+                           "${withval}/apps/openssl" version >/dev/null 2>&1; then
+                               openssl_bin_PATH="${withval}/apps${PATH_SEPARATOR}${PATH}"
+                       fi
                fi
        ]
 )