summaryrefslogtreecommitdiffstats
path: root/plugins/sudoers/regress/testsudoers/test20.sh
blob: 432517529ded2204a4dc9cec469711e2878a0d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# Verify CHROOT and CWD support
# This will catch an unpatched double-free in set_cmnd_path() under ASAN.
#

: ${TESTSUDOERS=testsudoers}

exec 2>&1

# Exercise double free of user_cmnd in set_cmnd_path() under ASAN.
# We need more than one rule where the last rule matches and has CHROOT.
$TESTSUDOERS root /bin/ls <<'EOF'
root ALL = CWD=/ /bin/pwd
root ALL = CHROOT=/ /bin/ls
EOF

exit 0