summaryrefslogtreecommitdiffstats
path: root/plugins/sudoers/regress/testsudoers/test22.sh
blob: 9d4dbcb8470039c8c43ff2ecbbcd658fed936272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# Verify that a user is only allowed to run commands with a group
# that is specified by sudoers (or that the runas user is a member of).
# This tests a bug fixed in sudo 1.9.14.
#

: ${TESTSUDOERS=testsudoers}

exec 2>&1

# The root user must *not* belong to the group specified below.
$TESTSUDOERS -u root -g bin -p ${TESTDIR}/passwd -P ${TESTDIR}/group \
    admin /bin/ls <<'EOF'
admin ALL = /bin/ls
EOF

exit 0