Bug 363 - unwanted characters in filename when using include directive
unwanted characters in filename when using include directive
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Visudo
1.7.1
HP HP-UX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-17 19:19 MDT by John
Modified: 2009-07-29 10:46 MDT (History)
0 users

See Also:


Attachments
fix for %h interpolation (390 bytes, patch)
2009-07-18 09:48 MDT, Todd C. Miller
Details | Diff
complete fix for %h interpolation (782 bytes, patch)
2009-07-18 09:50 MDT, Todd C. Miller
Details | Diff

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