* init.cfg (sanitizer_build_): Add a helper to detect if a program
is built against a sanitizer.
* tests/df/no-mtab-status-masked-proc.sh: Skip if a sanitizer build.
fi
}
+# Return true if passed program is built with ASAN, or UBSAN etc.
+sanitizer_build_()
+{
+ env $(printf '%sSAN_OPTIONS=help=1 ' A UB L M T) "$1" --version 2>&1 |
+ grep '[Ss]anitizer' >/dev/null
+}
+
sanitize_path_
print_ver_ df
skip_if_root_
+# Sanitizers need to read from /proc
+sanitizer_build_ df && skip_ 'Sanitizer not supported'
+
# Protect against inaccessible remote mounts etc.
timeout 10 df || skip_ "df fails"
# mask /proc
df() {
unshare -rm $SHELL -c \
- "mount -t tmpfs tmpfs /proc && command df \"\$@\"" -- "$@";
+ "mount -t tmpfs tmpfs /proc && env df \"\$@\"" -- "$@";
}
df /proc || fail=1