In #212 we have a case of broken NX caused by an undefined s_readelf variable. This thing is actually caught by shellcheck if you run it on the concatenated script without flags, having the inline annotations take care of everything:
$ ./shellcheck ./checksec
In ./cso.sh line 726:
if [[ $(${s_readelf} -l "${1}" 2> /dev/null | grep -A 1 'GNU_STACK' | sed 'N;s/\n//g' | grep -Eo "0x[0-9a-f]{16}" | grep -v 0x0000000000000000 | wc -l) -gt 0 ]]; then
^----------^ SC2154 (warning): s_readelf is referenced but not assigned.
In ./cso.sh line 1736:
exit 0
^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
For more information:
https://www.shellcheck.net/wiki/SC2154 -- s_readelf is referenced but not a...
https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable...
In #212 we have a case of broken NX caused by an undefined
s_readelf
variable. This thing is actually caught byshellcheck
if you run it on the concatenated script without flags, having the inline annotations take care of everything:(Yes, this is the in-repo version.)