Add support for regress tests using testsudoers

This commit is contained in:
Todd C. Miller
2011-01-07 13:19:32 -05:00
parent 217d296111
commit b679e03195
3 changed files with 31 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
Parses OK.
Entries for user root:
ALL = ALL
host matched
Command unmatched

View File

@@ -0,0 +1,20 @@
#!/bin/sh
#
# Test for NULL dereference with "sudo -g group" when the sudoers rule
# has no runas user or group listed.
# This is RedHat bug Bug 667103.
#
WANT=${SRCDIR-.}/regress/testsudoers/test1.ok
GOT=test1.out
./testsudoers -g wheel root id > $GOT <<EOF
root ALL = ALL
EOF
# Check results
if cmp $WANT $GOT >/dev/null; then
echo "testsudoers 1: OK"
else
echo "testsudoers 1: FAILED"
diff $WANT $GOT
fi