Bug 509 - [1.7.7] conflicting errno definitions due to header misordering in alias.c
[1.7.7] conflicting errno definitions due to header misordering in alias.c
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.7
PC Other
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-30 09:31 MDT by Matthias Rampke
Modified: 2011-10-22 19:43 MDT (History)
0 users

See Also:


Attachments
reorder includes in alias.c (286 bytes, application/octet-stream)
2011-08-30 09:31 MDT, Matthias Rampke
Details

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