2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00
Todd C. Miller e9d65e67aa Treat unresolvable User_Alias/Host_Alias as non-aliases in JSON output.
This matches the behavior of the sudoers parser.  There is no way
to tell for sure if an upper case word is an alias or a user or
host name.  An unresolvable command alias is never a command since
it doesn't start with a '/'.  GitHub issue #381
2024-06-07 10:54:35 -06:00

19 lines
406 B
Bash

#!/bin/sh
#
# Test behavior of undefined aliases using --expand-aliases in JSON output.
# https://github.com/sudo-project/sudo/issues/381
#
: ${CVTSUDOERS=cvtsudoers}
$CVTSUDOERS -c "" -f json -e <<EOF
User_Alias CLI_USER = cli
Defaults:CLI_USR !lecture
Host_Alias SUN_HOST = sparc5
Defaults@SUN_HST log_year
Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
Defaults!REBOT !use_pty
EOF