Skip to content

Commit fe7233f

Browse files
authored
fix: avoid using libc as an executable test (microsoft#202680)
1 parent 2e3df8a commit fe7233f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

resources/server/bin/helpers/check-requirements-linux.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,7 @@ if [ -n "$(ldd --version | grep -v musl)" ]; then
8181
# Rather than trusting the output of ldd --version (which is not always accurate)
8282
# we instead use the version of the cached libc.so.6 file itself.
8383
libc_real_path=$(readlink -f "$libc_path")
84-
if [ -x "$libc_real_path" ]; then
85-
# get version from executable
86-
libc_version=$($libc_real_path --version | sed -n 's/.*release version \([0-9]\+\.[0-9]\+\).*/\1/p')
87-
else
88-
# .so is not executable on this host; try getting from strings
89-
libc_version=$(cat "$libc_real_path" | sed -n 's/.*release version \([0-9]\+\.[0-9]\+\).*/\1/p')
90-
fi
84+
libc_version=$(cat "$libc_real_path" | sed -n 's/.*release version \([0-9]\+\.[0-9]\+\).*/\1/p')
9185
if [ "$(printf '%s\n' "2.28" "$libc_version" | sort -V | head -n1)" = "2.28" ]; then
9286
found_required_glibc=1
9387
else

0 commit comments

Comments
 (0)