summaryrefslogtreecommitdiffstats
path: root/check_sec.sh
diff options
context:
space:
mode:
authorWilliam Yardley <wyardley@users.noreply.github.com>2020-08-22 07:43:15 -0700
committerWilliam Yardley <wyardley@users.noreply.github.com>2020-08-25 19:59:54 -0700
commit3f856d1192ae9fd189f94e7c2c04362c4a090f26 (patch)
tree3ee14ddcca4a5e2b5c7a46a792365ac39088c67d /check_sec.sh
parent6f4c0f7abe00a36b70fdff0519c86e670a348e94 (diff)
refactor: update shell scripts for shellcheck warnings
This updates shell scripts in the project to resolve shellcheck lint warnings. A couple of warnings are ignored instead, at least for now.
Diffstat (limited to 'check_sec.sh')
-rwxr-xr-xcheck_sec.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/check_sec.sh b/check_sec.sh
index 73ac3d54..3655aecb 100755
--- a/check_sec.sh
+++ b/check_sec.sh
@@ -4,7 +4,7 @@
# grep for some things which may look like security problems.
#
-TMPFILE="`mktemp check_sec.tmp.XXXXXX`" || exit 1
+TMPFILE=`mktemp check_sec.tmp.XXXXXX` || exit 1
RV=0;
@@ -13,9 +13,9 @@ do_check_files ()
pattern="$1" ; shift
magic="$1" ; shift
msg="$1" ; shift
- egrep -n "$pattern" "$@" | \
+ grep -En "$pattern" "$@" | \
grep -v '^[^ ]*:[^ ]*#' | \
- fgrep -v "$magic" > $TMPFILE
+ grep -Fv "$magic" > $TMPFILE
test -s $TMPFILE && {
echo "$msg" ;
@@ -41,7 +41,7 @@ do_check '\<FREE[ ]?\([^&]' __FREE_CHECKED__ "You probably meant FREE(&...) here
# don't do this check on others' code.
do_check_files '\<(malloc|realloc|free|strdup)[ ]*\(' __MEM_CHECKED__ "Alert: Use of traditional memory management calls." \
- *.c imap/*.c autocrypt/*.c
+ ./*.c imap/*.c autocrypt/*.c
rm -f $TMPFILE
exit $RV