From: Takashi Yano Date: Wed, 19 Feb 2025 23:37:27 +0000 (+0200) Subject: ltmain.in: Fix mistaking a directory as an executable X-Git-Tag: v2.6.0~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=961aa57f1466dc2dcd28b8419deb4621865411a6;p=thirdparty%2Flibtool.git ltmain.in: Fix mistaking a directory as an executable find_executable() can return a directory of the same name as the target executable if the directory is found earlier in the PATH, which causes check_executable() to fail. Reported: https://savannah.gnu.org/support/?111191 * build-aux/ltmain.in: Check if directory is found before executable in the PATH. --- diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index c59459d05..36a85b9e1 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -4241,7 +4241,7 @@ check_executable (const char *path) if ((!path) || (!*path)) return 0; - if ((stat (path, &st) >= 0) + if ((stat (path, &st) >= 0) && !S_ISDIR (st.st_mode) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else