diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 0360b4280..458c87572 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -574,7 +574,8 @@ check: $(TEST_PROGS) visudo testsudoers cvtsudoers out="regress/$$dir/$${base}.out"; \ err="regress/$$dir/$${base}.err"; \ status=0; \ - TESTDIR=$(srcdir)/regress/$$dir \ + TESTSUDOERS=./testsudoers VISUDO=./visudo \ + CVTSUDOERS=./cvtsudoers TESTDIR=$(srcdir)/regress/$$dir \ $(SHELL) $$t >$$out 2>$$err || status=$$?; \ if cmp $$out $(srcdir)/$$out.ok >/dev/null; then \ if test $$status -ne 0; then \ diff --git a/plugins/sudoers/regress/cvtsudoers/test1.sh b/plugins/sudoers/regress/cvtsudoers/test1.sh index c1bd00152..ba5f87f1f 100755 --- a/plugins/sudoers/regress/cvtsudoers/test1.sh +++ b/plugins/sudoers/regress/cvtsudoers/test1.sh @@ -3,6 +3,8 @@ # Test user and host filters # -./cvtsudoers -c "" -f sudoers -m user=millert,host=hercules $TESTDIR/sudoers +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -f sudoers -m user=millert,host=hercules $TESTDIR/sudoers exit 0 diff --git a/plugins/sudoers/regress/cvtsudoers/test10.sh b/plugins/sudoers/regress/cvtsudoers/test10.sh index 3ca1691cb..38550a938 100755 --- a/plugins/sudoers/regress/cvtsudoers/test10.sh +++ b/plugins/sudoers/regress/cvtsudoers/test10.sh @@ -3,6 +3,8 @@ # Test command defaults filtering # -./cvtsudoers -c "" -f sudoers -s aliases,privileges -d command $TESTDIR/sudoers +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -f sudoers -s aliases,privileges -d command $TESTDIR/sudoers exit 0 diff --git a/plugins/sudoers/regress/cvtsudoers/test11.sh b/plugins/sudoers/regress/cvtsudoers/test11.sh index 7cbae9fe8..f8d37ef09 100755 --- a/plugins/sudoers/regress/cvtsudoers/test11.sh +++ b/plugins/sudoers/regress/cvtsudoers/test11.sh @@ -3,4 +3,6 @@ # Test that Aliases are removed when filtering by defaults type # -./cvtsudoers -c "" -f sudoers -d command $TESTDIR/sudoers.defs +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -f sudoers -d command $TESTDIR/sudoers.defs diff --git a/plugins/sudoers/regress/cvtsudoers/test12.sh b/plugins/sudoers/regress/cvtsudoers/test12.sh index 3ac1f5958..dd2cab079 100755 --- a/plugins/sudoers/regress/cvtsudoers/test12.sh +++ b/plugins/sudoers/regress/cvtsudoers/test12.sh @@ -3,4 +3,6 @@ # Test that Aliases are removed when filtering by defaults type # -./cvtsudoers -c "" -f sudoers -d user $TESTDIR/sudoers.defs +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -f sudoers -d user $TESTDIR/sudoers.defs diff --git a/plugins/sudoers/regress/cvtsudoers/test13.sh b/plugins/sudoers/regress/cvtsudoers/test13.sh index 44424263d..8ee6000a0 100755 --- a/plugins/sudoers/regress/cvtsudoers/test13.sh +++ b/plugins/sudoers/regress/cvtsudoers/test13.sh @@ -3,4 +3,6 @@ # Test that Aliases are removed when filtering by defaults type # -./cvtsudoers -c "" -f sudoers -d host $TESTDIR/sudoers.defs +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -f sudoers -d host $TESTDIR/sudoers.defs diff --git a/plugins/sudoers/regress/cvtsudoers/test14.sh b/plugins/sudoers/regress/cvtsudoers/test14.sh index 90637a71e..4486faa10 100755 --- a/plugins/sudoers/regress/cvtsudoers/test14.sh +++ b/plugins/sudoers/regress/cvtsudoers/test14.sh @@ -3,4 +3,6 @@ # Test that Aliases are removed when filtering by defaults type # -./cvtsudoers -c "" -f sudoers -d runas $TESTDIR/sudoers.defs +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -f sudoers -d runas $TESTDIR/sudoers.defs diff --git a/plugins/sudoers/regress/cvtsudoers/test15.sh b/plugins/sudoers/regress/cvtsudoers/test15.sh index 5e02f6192..6d65c78ec 100755 --- a/plugins/sudoers/regress/cvtsudoers/test15.sh +++ b/plugins/sudoers/regress/cvtsudoers/test15.sh @@ -3,6 +3,8 @@ # Test filters and pruning # -./cvtsudoers -c "" -f sudoers -p -m user=user1 < LDIF -> sudoers # -./cvtsudoers -c "" -b "ou=SUDOers,dc=sudo,dc=ws" $TESTDIR/test23.out.ok | \ - ./cvtsudoers -c "" -i LDIF -f sudoers | grep -v '^#' +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -b "ou=SUDOers,dc=sudo,dc=ws" $TESTDIR/test23.out.ok | \ + $CVTSUDOERS -c "" -i LDIF -f sudoers | grep -v '^#' diff --git a/plugins/sudoers/regress/cvtsudoers/test24.sh b/plugins/sudoers/regress/cvtsudoers/test24.sh index 0399715a9..72d9983e2 100755 --- a/plugins/sudoers/regress/cvtsudoers/test24.sh +++ b/plugins/sudoers/regress/cvtsudoers/test24.sh @@ -3,5 +3,7 @@ # Test round-tripping of LDIF -> sudoers -> LDIF # -./cvtsudoers -c "" -i LDIF -f sudoers $TESTDIR/test24.out.ok | \ - ./cvtsudoers -c "" -b "ou=SUDOers,dc=sudo,dc=ws" +: ${CVTSUDOERS=cvtsudoers} + +$CVTSUDOERS -c "" -i LDIF -f sudoers $TESTDIR/test24.out.ok | \ + $CVTSUDOERS -c "" -b "ou=SUDOers,dc=sudo,dc=ws" diff --git a/plugins/sudoers/regress/cvtsudoers/test25.sh b/plugins/sudoers/regress/cvtsudoers/test25.sh index 3ecb88e2c..bbb9b51ac 100755 --- a/plugins/sudoers/regress/cvtsudoers/test25.sh +++ b/plugins/sudoers/regress/cvtsudoers/test25.sh @@ -3,7 +3,9 @@ # Test LDIF base64 attribute parsing # -./cvtsudoers -c "" -i ldif -b "ou=SUDOers,dc=sudo,dc=ws" -I 10 -O 10 <&1 -./testsudoers -g bin -P ${TESTDIR}/group root id <"$TESTDIR/test 10.inc" <&1 echo "Testing @include of a path with escaped white space" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF @include $TESTDIR/test\ 10.inc EOF echo "" echo "Testing @include of a double-quoted path with white space" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF @include "$TESTDIR/test 10.inc" EOF echo "" echo "Testing #include of a path with escaped white space" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF #include $TESTDIR/test\ 10.inc EOF echo "" echo "Testing #include of a double-quoted path with white space" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF #include "$TESTDIR/test 10.inc" EOF diff --git a/plugins/sudoers/regress/testsudoers/test11.sh b/plugins/sudoers/regress/testsudoers/test11.sh index 802afa9b2..79bdadd90 100755 --- a/plugins/sudoers/regress/testsudoers/test11.sh +++ b/plugins/sudoers/regress/testsudoers/test11.sh @@ -4,6 +4,8 @@ # The standard error output is dup'd to the standard output. # +: ${TESTSUDOERS=testsudoers} + # Avoid warnings about memory leaks when there is a syntax error ASAN_OPTIONS=detect_leaks=0; export ASAN_OPTIONS @@ -12,14 +14,14 @@ MYGID=`\ls -ln $TESTDIR/test2.inc | awk '{print $4}'` echo "Testing @include with garbage after the path name" echo "" -./testsudoers -U $MYUID -G $MYGID root id <&1 | sed 's/\(syntax error\), .*/\1/' +$TESTSUDOERS -U $MYUID -G $MYGID root id <&1 | sed 's/\(syntax error\), .*/\1/' @include sudoers.local womp womp EOF echo "" echo "Testing #include with garbage after the path name" echo "" -./testsudoers -U $MYUID -G $MYGID root id <&1 | sed 's/\(syntax error\), .*/\1/' +$TESTSUDOERS -U $MYUID -G $MYGID root id <&1 | sed 's/\(syntax error\), .*/\1/' #include sudoers.local womp womp EOF diff --git a/plugins/sudoers/regress/testsudoers/test12.sh b/plugins/sudoers/regress/testsudoers/test12.sh index 0a1510c5c..d496e3dcf 100755 --- a/plugins/sudoers/regress/testsudoers/test12.sh +++ b/plugins/sudoers/regress/testsudoers/test12.sh @@ -4,12 +4,14 @@ # The standard error output is dup'd to the standard output. # +: ${TESTSUDOERS=testsudoers} + # Avoid warnings about memory leaks when there is a syntax error ASAN_OPTIONS=detect_leaks=0; export ASAN_OPTIONS echo "Testing sudoers with multiple syntax errors" echo "" -./testsudoers -d <&1 | sed 's/\(syntax error\), .*/\1/' +$TESTSUDOERS -d <&1 | sed 's/\(syntax error\), .*/\1/' User_Alias A1 = u1 u2 : A2 = u3, u4 millert ALL = /fail : foo diff --git a/plugins/sudoers/regress/testsudoers/test13.sh b/plugins/sudoers/regress/testsudoers/test13.sh index f318d9e2c..e33cbb1c2 100755 --- a/plugins/sudoers/regress/testsudoers/test13.sh +++ b/plugins/sudoers/regress/testsudoers/test13.sh @@ -4,12 +4,14 @@ # The standard error output is dup'd to the standard output. # +: ${TESTSUDOERS=testsudoers} + # Avoid warnings about memory leaks when there is a syntax error ASAN_OPTIONS=detect_leaks=0; export ASAN_OPTIONS echo "Testing alias definitions using reserved words" echo "" -./testsudoers -d <&1 +$TESTSUDOERS -d <&1 Cmnd_Alias ALL=ALL Cmnd_Alias CHROOT=foo User_Alias TIMEOUT=foo diff --git a/plugins/sudoers/regress/testsudoers/test14.sh b/plugins/sudoers/regress/testsudoers/test14.sh index 78350d706..7739c676d 100755 --- a/plugins/sudoers/regress/testsudoers/test14.sh +++ b/plugins/sudoers/regress/testsudoers/test14.sh @@ -3,21 +3,23 @@ # Test entries with no trailing newline. # +: ${TESTSUDOERS=testsudoers} + exec 2>&1 echo "" echo "Testing user privilege without a newline" echo "" -printf "millert ALL = ALL" | ./testsudoers -d +printf "millert ALL = ALL" | $TESTSUDOERS -d echo "" echo "Testing alias without a newline" echo "" -printf "Cmnd_Alias FOO=/bin/bar" | ./testsudoers -d +printf "Cmnd_Alias FOO=/bin/bar" | $TESTSUDOERS -d echo "" echo "Testing Defaults without a newline" echo "" -printf "Defaults log_output" | ./testsudoers -d +printf "Defaults log_output" | $TESTSUDOERS -d exit 0 diff --git a/plugins/sudoers/regress/testsudoers/test15.sh b/plugins/sudoers/regress/testsudoers/test15.sh index b8cdf7ebf..a4596cd28 100755 --- a/plugins/sudoers/regress/testsudoers/test15.sh +++ b/plugins/sudoers/regress/testsudoers/test15.sh @@ -3,6 +3,8 @@ # Test @include of a file with a missing newline # +: ${TESTSUDOERS=testsudoers} + # Create test file TESTDIR="`pwd`/regress/testsudoers" printf "root ALL = ALL" >"$TESTDIR/test15.inc" @@ -13,7 +15,7 @@ exec 2>&1 echo "Testing @include of a file with a missing newline" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF @include $TESTDIR/test15.inc ALL ALL = /usr/bin/id EOF diff --git a/plugins/sudoers/regress/testsudoers/test2.sh b/plugins/sudoers/regress/testsudoers/test2.sh index a36922d16..0b0b3f88d 100755 --- a/plugins/sudoers/regress/testsudoers/test2.sh +++ b/plugins/sudoers/regress/testsudoers/test2.sh @@ -3,20 +3,22 @@ # Test @include facility # +: ${TESTSUDOERS=testsudoers} + MYUID=`\ls -ln $TESTDIR/test2.inc | awk '{print $3}'` MYGID=`\ls -ln $TESTDIR/test2.inc | awk '{print $4}'` exec 2>&1 echo "Testing @include" echo "" -./testsudoers -U $MYUID -G $MYGID root id <&1 echo "Testing @includedir of an unquoted path" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF @includedir $TESTDIR/test3.d EOF echo "" echo "Testing @includedir of a double-quoted path" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF @includedir "$TESTDIR/test3.d" EOF echo "" echo "Testing #includedir of an unquoted path" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF #includedir $TESTDIR/test3.d EOF echo "" echo "Testing #includedir of a double-quoted path" echo "" -./testsudoers -U $MYUID -G $MYGID root id <<-EOF +$TESTSUDOERS -U $MYUID -G $MYGID root id <<-EOF #includedir "$TESTDIR/test3.d" EOF diff --git a/plugins/sudoers/regress/testsudoers/test4.sh b/plugins/sudoers/regress/testsudoers/test4.sh index e659a9a2b..2ec47cead 100755 --- a/plugins/sudoers/regress/testsudoers/test4.sh +++ b/plugins/sudoers/regress/testsudoers/test4.sh @@ -3,11 +3,13 @@ # Test sudoers owner check # +: ${TESTSUDOERS=testsudoers} + # 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 <"$TESTFILE" <&1 # Test world writable chmod 666 $TESTFILE -./testsudoers -U $MYUID -G $MYGID root id <&1 -./testsudoers root id <&1 -./testsudoers root id <&1 @@ -11,12 +13,12 @@ exec 2>&1 echo "Testing @include without a newline" echo "" printf "@include $TESTDIR/test2.inc" | \ - ./testsudoers -U $MYUID -G $MYGID root id + $TESTSUDOERS -U $MYUID -G $MYGID root id echo "" echo "Testing #include without a newline" echo "" printf "#include $TESTDIR/test2.inc" | \ - ./testsudoers -U $MYUID -G $MYGID root id + $TESTSUDOERS -U $MYUID -G $MYGID root id exit 0 diff --git a/plugins/sudoers/regress/testsudoers/test9.sh b/plugins/sudoers/regress/testsudoers/test9.sh index d76cfbbe3..850bbacae 100755 --- a/plugins/sudoers/regress/testsudoers/test9.sh +++ b/plugins/sudoers/regress/testsudoers/test9.sh @@ -3,10 +3,12 @@ # Test #include facility # +: ${TESTSUDOERS=testsudoers} + MYUID=`\ls -ln $TESTDIR/test2.inc | awk '{print $3}'` MYGID=`\ls -ln $TESTDIR/test2.inc | awk '{print $4}'` exec 2>&1 -./testsudoers -U $MYUID -G $MYGID root id <root !set_logname Defaults:FULLTIMERS !lecture diff --git a/plugins/sudoers/regress/visudo/test7.sh b/plugins/sudoers/regress/visudo/test7.sh index 9f30923a7..b993fe74d 100755 --- a/plugins/sudoers/regress/visudo/test7.sh +++ b/plugins/sudoers/regress/visudo/test7.sh @@ -3,13 +3,15 @@ # Test sudoers_locale early Defaults # +: ${VISUDO=visudo} + LANG=C; export LANG LC_NUMERIC=fr_FR.UTF-8; export LC_NUMERIC # First check that visudo supports non-C locales # Note that older versions of sudo did not set the locale # until sudoers was read so this check will fail on them. -./visudo -csf - >/dev/null 2>&1 <<-EOF +$VISUDO -csf - >/dev/null 2>&1 <<-EOF Defaults sudoers_locale = fr_FR.UTF-8 Defaults passwd_timeout = "2,5" EOF @@ -17,7 +19,7 @@ LC_NUMERIC=fr_FR.UTF-8; export LC_NUMERIC # Now make sure we can set passwd_timeout to a floating point value # using a non-C locale. if [ $? -eq 0 ]; then - ./visudo -csf - <<-EOF + $VISUDO -csf - <<-EOF Defaults passwd_timeout = "2,5" Defaults sudoers_locale = fr_FR.UTF-8 EOF diff --git a/plugins/sudoers/regress/visudo/test8.sh b/plugins/sudoers/regress/visudo/test8.sh index db68a6d99..85bdd9f8f 100755 --- a/plugins/sudoers/regress/visudo/test8.sh +++ b/plugins/sudoers/regress/visudo/test8.sh @@ -3,13 +3,15 @@ # Test sudoers_locale early Defaults # +: ${VISUDO=visudo} + LANG=C; export LANG LC_NUMERIC=fr_FR.UTF-8; export LC_NUMERIC # First check that visudo supports non-C locales # Note that older versions of sudo did not set the locale # until sudoers was read so this check will fail on them. -./visudo -csf - >/dev/null 2>&1 <<-EOF +$VISUDO -csf - >/dev/null 2>&1 <<-EOF Defaults sudoers_locale = fr_FR.UTF-8 Defaults passwd_timeout = "2,5" EOF @@ -17,7 +19,7 @@ LC_NUMERIC=fr_FR.UTF-8; export LC_NUMERIC # Now make sure we can set passwd_timeout to a floating point value # using a non-C locale. if [ $? -eq 0 ]; then - ./visudo -csf - <<-EOF + $VISUDO -csf - <<-EOF Defaults passwd_timeout = "2.5" Defaults sudoers_locale = fr_FR.UTF-8 EOF diff --git a/plugins/sudoers/regress/visudo/test9.sh b/plugins/sudoers/regress/visudo/test9.sh index d62fb8839..175ad6e80 100755 --- a/plugins/sudoers/regress/visudo/test9.sh +++ b/plugins/sudoers/regress/visudo/test9.sh @@ -4,7 +4,9 @@ # Bugzilla #766 # -./visudo -cf - <<-EOF +: ${VISUDO=visudo} + +$VISUDO -cf - <<-EOF Defaults@127.0.0.1 !authenticate Defaults@10.0.0.0/8 !always_set_home EOF