Skip to content

Commit 382313e

Browse files
committed
Expand test for the runas fix in sudo 1.9.14
We also need to verify that the user is not allowed to run commands with just their own group if sudoers doesn't explicitly permit it.
1 parent 8fa877f commit 382313e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

plugins/sudoers/regress/testsudoers/test23.out.ok

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Testing with user and group set to invoking user:
2+
3+
Parses OK
4+
5+
Entries for user admin:
6+
7+
ALL = (root) /bin/ls
8+
host allowed
9+
runas unmatched
10+
11+
Password required
12+
13+
Command unmatched
14+
Testing with no user and group set to invoking user:
15+
116
Parses OK
217

318
Entries for user admin:

plugins/sudoers/regress/testsudoers/test23.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@
99

1010
exec 2>&1
1111

12+
echo "Testing with user and group set to invoking user:"
13+
echo ""
1214
$TESTSUDOERS -u admin -g admin -p ${TESTDIR}/passwd -P ${TESTDIR}/group \
1315
admin /bin/ls <<'EOF'
1416
admin ALL = (root) /bin/ls
1517
EOF
1618

19+
echo "Testing with no user and group set to invoking user:"
20+
echo ""
21+
$TESTSUDOERS -g admin -p ${TESTDIR}/passwd -P ${TESTDIR}/group \
22+
admin /bin/ls <<'EOF'
23+
admin ALL = (root) /bin/ls
24+
EOF
25+
1726
exit 0

0 commit comments

Comments
 (0)