Bug 580 - Incorrect unused host error message.
Incorrect unused host error message.
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Visudo
1.8.6
PC Linux
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-26 17:19 MST by John Taisto
Modified: 2013-08-17 06:36 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.