From 50d0191de3dd4724b6be2d000acb56e3478c0097 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 15 Sep 2016 08:33:01 -0600 Subject: [PATCH] Disable Address Sanitizer leak detection for tests which generate parse errors. The parser leaks a bit on error. --- plugins/sudoers/Makefile.in | 3 ++- plugins/sudoers/regress/testsudoers/test4.sh | 3 +++ plugins/sudoers/regress/testsudoers/test5.sh | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 626965643..ba7f631af 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -386,7 +386,8 @@ check: $(TEST_PROGS) visudo testsudoers out="regress/sudoers/$${base}.out"; \ toke="regress/sudoers/$${base}.toke"; \ json="regress/sudoers/$${base}.json"; \ - ./testsudoers -dt <$$t >$$out 2>$$toke || true; \ + ASAN_OPTIONS=detect_leaks=0 \ + ./testsudoers -dt <$$t >$$out 2>$$toke || true; \ if cmp $$out $(srcdir)/$$out.ok >/dev/null; then \ passed=`expr $$passed + 1`; \ echo "$$dir/$$base (parse): OK"; \ diff --git a/plugins/sudoers/regress/testsudoers/test4.sh b/plugins/sudoers/regress/testsudoers/test4.sh index 03947f34c..3eaaa1dac 100755 --- a/plugins/sudoers/regress/testsudoers/test4.sh +++ b/plugins/sudoers/regress/testsudoers/test4.sh @@ -3,6 +3,9 @@ # Test sudoers owner check # +# Avoid warnings about memory leaks when there is a syntax error +ASAN_OPTIONS=detect_leaks=0; export ASAN_OPTIONS + exec 2>&1 ./testsudoers -U 1 root id <$TESTFILE <