Bug 363

Summary: unwanted characters in filename when using include directive
Product: Sudo Reporter: John <john.carroll>
Component: VisudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.7.1   
Hardware: HP   
OS: HP-UX   
Attachments: fix for %h interpolation
complete fix for %h interpolation

Description John 2009-07-17 19:19:47 MDT
I am trying to utilize the include directive within the sudoers configuration file.  I am using the syntax:

#include /etc/sudoers.%h

This appears on a line all by itself and it starts in the first position of the line of the sudoers config file (/usr/local/etc/sudoers)

The file that gets generated has the following name (listed with non-printable characters displayed):

sol3d# ls -b /etc/sudoers.*
/etc/sudoers.sol3d\012

somehow the %h is including a carriage return at the end of the filename.  The file is being created this way when using visudo to edit the config files.
Comment 1 Todd C. Miller 2009-07-18 09:48:15 MDT
Created attachment 262 [details]
fix for %h interpolation
Comment 2 Todd C. Miller 2009-07-18 09:48:39 MDT
I've attached a patch which should fix the issue
Comment 3 Todd C. Miller 2009-07-18 09:50:21 MDT
Created attachment 263 [details]
complete fix for %h interpolation
Comment 4 Todd C. Miller 2009-07-29 10:46:35 MDT
fixed in sudo 1.7.2p1