mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
Add test of multiple syntax errors.
Where possible, the portion of the line before the error should be still be interpreted.
This commit is contained in:
parent
578789c56f
commit
a51d194a73
2
MANIFEST
2
MANIFEST
@ -827,6 +827,8 @@ plugins/sudoers/regress/testsudoers/test10.out.ok
|
|||||||
plugins/sudoers/regress/testsudoers/test10.sh
|
plugins/sudoers/regress/testsudoers/test10.sh
|
||||||
plugins/sudoers/regress/testsudoers/test11.out.ok
|
plugins/sudoers/regress/testsudoers/test11.out.ok
|
||||||
plugins/sudoers/regress/testsudoers/test11.sh
|
plugins/sudoers/regress/testsudoers/test11.sh
|
||||||
|
plugins/sudoers/regress/testsudoers/test12.out.ok
|
||||||
|
plugins/sudoers/regress/testsudoers/test12.sh
|
||||||
plugins/sudoers/regress/testsudoers/test2.inc
|
plugins/sudoers/regress/testsudoers/test2.inc
|
||||||
plugins/sudoers/regress/testsudoers/test2.out.ok
|
plugins/sudoers/regress/testsudoers/test2.out.ok
|
||||||
plugins/sudoers/regress/testsudoers/test2.sh
|
plugins/sudoers/regress/testsudoers/test2.sh
|
||||||
|
15
plugins/sudoers/regress/testsudoers/test12.out.ok
Normal file
15
plugins/sudoers/regress/testsudoers/test12.out.ok
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Testing sudoers with multiple syntax errors
|
||||||
|
|
||||||
|
sudoers:1: syntax error
|
||||||
|
User_Alias A1 = u1 u2 : A2 = u3, u4
|
||||||
|
^~
|
||||||
|
sudoers:3: syntax error
|
||||||
|
millert ALL = /fail : foo
|
||||||
|
^
|
||||||
|
sudoers:5: syntax error
|
||||||
|
root ALL = ALL bar
|
||||||
|
^~~
|
||||||
|
|
||||||
|
User_Alias A1 = u1
|
||||||
|
|
||||||
|
millert ALL = /fail
|
18
plugins/sudoers/regress/testsudoers/test12.sh
Executable file
18
plugins/sudoers/regress/testsudoers/test12.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Test sudoers file with multiple syntax errors
|
||||||
|
# The standard error output is dup'd to the standard output.
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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 <<EOF 2>&1 | sed 's/\(syntax error\), .*/\1/'
|
||||||
|
User_Alias A1 = u1 u2 : A2 = u3, u4
|
||||||
|
|
||||||
|
millert ALL = /fail : foo
|
||||||
|
|
||||||
|
root ALL = ALL bar
|
||||||
|
EOF
|
Loading…
x
Reference in New Issue
Block a user