xref: /xnu-10002.61.3/san/tools/validate_blacklist.sh (revision 0f4c859e951fba394238ab619495c4e1d54d0f34)
1#!/bin/bash
2
3# Ensure all blacklisted files exist. Paths with wildcards are ignored.
4# Run against a blacklist with fully-qualified paths.
5
6IFS=$'\n'
7
8blacklist_files=`sed -n -e '
9	# ignore paths with wildcards
10	/\*/ d
11
12	# strip leading 'src:'
13	/^src/ {
14		s/^src://
15		p
16	}
17' $1`
18
19ret=0
20
21for f in $blacklist_files ; do
22	if ! [[ -e $f ]] ; then
23		echo "KASan: blacklisted file $f not found" >&2
24		ret=1
25	fi
26done
27
28exit $ret
29