@Bob, thanks for your time.
Answers to Bob's questions
>I am hoping LOCALHOST doesn't collide with some special variable
Well, not in the bashshell (see below). Anyway this is not relevant: the the
sudo --list does not show that /usr/local/sbin/testicolo may be excuted by ric
in contrast with the the rule with an explicit short name.
>What is the hostname of your system?
SHORT name
>Do you have it installed?
Yes (automatically).
ric
Shell excerpts (with the same replacements of fake domain/machine as in my
previous post).
root@mymachine:~# cat /etc/sudoers.d/local_sudoers
Host_Alias LOCALHOST = mymachine.somewhere.fr
Cmnd_Alias SYNC = /usr/local/sbin/sync2all, /usr/local/sbin/sync2cnrs
ric LOCALHOST = (root) NOPASSWD:SYNC
root@mymachine:~# echo ${LOCALHOST}
root@mymachine:~# cat /etc/hostname
mymachine
root@mymachine:~# grep -e '^127.0' -e '^::1' /etc/hosts
127.0.0.1 localhost
127.0.1.1 mymachine.somewhere.fr mymachine
::1 localhost ip6-localhost ip6-loopback
root@mymachine:~# cat /etc/nsswitch.conf |egrep hosts
hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4
root@mymachine:~# aptitude search libnss-myhostname
i A libnss-myhostname - nss module
providing fallback resolution for the current hostname
root@mymachine:~#