Bug 509

Summary: [1.7.7] conflicting errno definitions due to header misordering in alias.c
Product: Sudo Reporter: Matthias Rampke <matthias.rampke>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.7.7   
Hardware: PC   
OS: Other   
Attachments: reorder includes in alias.c

Description Matthias Rampke 2011-08-30 09:31:51 MDT
Created attachment 315 [details]
reorder includes in alias.c

This commit http://www.sudo.ws/repos/sudo/rev/c2fa4faa8abf includes <errno.h> in alias.c, but only after "sudo.h". the latter has a conditional definition for errno (extern int) which conflicts with the system definition on DragonFly BSD (extern __thread int).

errno probably shouldn't be defined outside of errno.h, but the attached include reordering in alias.c at least alleviates this issue.
Comment 1 Matthias Rampke 2011-08-30 09:41:37 MDT
also see http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45280
Comment 2 Todd C. Miller 2011-08-30 09:50:51 MDT
Thanks, I've checked in the fix for that typo in the sudo 1.7 and 1.8 branches.  The errno declaration is only needed on obsolete systems where errno is not declared for you.  I will add a configure check instead of declaring it unilaterally in sudo.h.
Comment 3 Todd C. Miller 2011-08-30 10:40:59 MDT
The next version of sudo will include a check for an errno declaration in errno.h
Comment 4 Todd C. Miller 2011-10-22 19:40:54 MDT
Sudo 1.7.8 and 1.8.3 are out now which have this fixed.