mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
Add test for matching a literal "" command line argument as "" in sudoers.
GitHub issue #182.
This commit is contained in:
parent
fa952bfbb7
commit
2e2dd48bef
2
MANIFEST
2
MANIFEST
@ -1020,6 +1020,8 @@ plugins/sudoers/regress/testsudoers/test17.out.ok
|
|||||||
plugins/sudoers/regress/testsudoers/test17.sh
|
plugins/sudoers/regress/testsudoers/test17.sh
|
||||||
plugins/sudoers/regress/testsudoers/test18.out.ok
|
plugins/sudoers/regress/testsudoers/test18.out.ok
|
||||||
plugins/sudoers/regress/testsudoers/test18.sh
|
plugins/sudoers/regress/testsudoers/test18.sh
|
||||||
|
plugins/sudoers/regress/testsudoers/test19.out.ok
|
||||||
|
plugins/sudoers/regress/testsudoers/test19.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
|
||||||
|
20
plugins/sudoers/regress/testsudoers/test19.out.ok
Normal file
20
plugins/sudoers/regress/testsudoers/test19.out.ok
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Parses OK
|
||||||
|
|
||||||
|
Entries for user root:
|
||||||
|
|
||||||
|
ALL = /bin/ls ""
|
||||||
|
host matched
|
||||||
|
runas matched
|
||||||
|
cmnd allowed
|
||||||
|
|
||||||
|
Command allowed
|
||||||
|
Parses OK
|
||||||
|
|
||||||
|
Entries for user root:
|
||||||
|
|
||||||
|
ALL = /bin/ls ""
|
||||||
|
host matched
|
||||||
|
runas matched
|
||||||
|
cmnd unmatched
|
||||||
|
|
||||||
|
Command unmatched
|
20
plugins/sudoers/regress/testsudoers/test19.sh
Executable file
20
plugins/sudoers/regress/testsudoers/test19.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Verify that "" in sudoers does not match a literal "" on the command line.
|
||||||
|
#
|
||||||
|
|
||||||
|
: ${TESTSUDOERS=testsudoers}
|
||||||
|
|
||||||
|
exec 2>&1
|
||||||
|
|
||||||
|
# This should succeed
|
||||||
|
$TESTSUDOERS root /bin/ls <<'EOF'
|
||||||
|
root ALL = /bin/ls ""
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# This should fail
|
||||||
|
$TESTSUDOERS root /bin/ls '""' <<'EOF'
|
||||||
|
root ALL = /bin/ls ""
|
||||||
|
EOF
|
||||||
|
|
||||||
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user