Bug 580

Summary: Incorrect unused host error message.
Product: Sudo Reporter: John Taisto <jrtaisto>
Component: VisudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.6   
Hardware: PC   
OS: Linux   

Description John Taisto 2012-11-26 17:19:45 MST
Getting an incorrect error for unused host if host is defined but is only referenced for a defaults setting.  Use visudo on the below sudoers content:

Host_Alias SOMEHOST                           = somehost, somehost.atsomedomain.com
Host_Alias SUDO_AUDIT_HOSTS                   = SOMEHOST

Defaults@SUDO_AUDIT_HOSTS log_year, logfile=/var/log/sudo_audit.log


You'll get the following error on 1.8.6p3 on LINUX RHEL 4:

visudo: Warning: unused Host_Alias SOMEHOST

It seems to happen on other versions too, like RHEL 6 with sudoers 1.7.4p5.

In my opinion I think you should be able to set a default for hosts even if nothing else is referenced for them in the sudoers file.  I believe this to be a bug for visudo to complain about it.  I think this kind of strategy is common with people who have a global sudoers file that's checked in and out of source control to manage their enterprise with one sudoers file--makes auditing easier.
Comment 1 Todd C. Miller 2012-11-26 18:18:16 MST
This is already fixed in sudo trunk.  The fix will be present in sudo 1.8.7.
Comment 2 Todd C. Miller 2013-08-17 06:36:02 MDT
Fixed in sudo 1.8.7.