xref: /xnu-11417.140.69/san/tools/validate_denylist.sh (revision 43a90889846e00bfb5cf1d255cdc0a701a1e05a4)
1#!/bin/bash
2
3# Ensure all denylisted files exist. Paths with wildcards are ignored.
4# Run against a denylist with fully-qualified paths.
5
6IFS=$'\n'
7
8denylist_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 $denylist_files ; do
22	if ! [[ -e $f ]] ; then
23		echo "KASan: denylisted file $f not found" >&2
24		ret=1
25	fi
26done
27
28exit $ret
29