Skip to content

Commit

Permalink
Properly escape the grep pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
petervas committed May 30, 2024
1 parent 4e982eb commit 3fa449a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions checksec
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ search_libc() {
LIBC_SEARCH_PATH=${LIBC_FILE}
fi
# otherwise use ldconfig to get the libc location
elif [[ -f $(ldconfig -p | grep libc.so | awk '{print $4}' | head -n 1) ]]; then
FS_libc=$(ldconfig -p | grep libc.so | awk '{print $4}' | head -n 1)
elif [[ -f $(ldconfig -p | grep 'libc\.so' | awk '{print $4}' | head -n 1) ]]; then
FS_libc=$(ldconfig -p | grep 'libc\.so' | awk '{print $4}' | head -n 1)
fi

# if a search path was given or ldconfig failed we need to search for libc
Expand Down
4 changes: 2 additions & 2 deletions src/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ search_libc() {
LIBC_SEARCH_PATH=${LIBC_FILE}
fi
# otherwise use ldconfig to get the libc location
elif [[ -f $(ldconfig -p | grep libc.so | awk '{print $4}' | head -n 1) ]]; then
FS_libc=$(ldconfig -p | grep libc.so | awk '{print $4}' | head -n 1)
elif [[ -f $(ldconfig -p | grep 'libc\.so' | awk '{print $4}' | head -n 1) ]]; then
FS_libc=$(ldconfig -p | grep 'libc\.so' | awk '{print $4}' | head -n 1)
fi

# if a search path was given or ldconfig failed we need to search for libc
Expand Down

0 comments on commit 3fa449a

Please sign in to comment.