Bug 624 - Tru64 compatibility fixes
Tru64 compatibility fixes
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.7
Alpha Tru64 UNIX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-16 23:38 MST by Daniel Richard G.
Modified: 2013-11-17 23:19 MST (History)
0 users

See Also:


Attachments
Patch #1 against sudo hg tip (1.85 KB, patch)
2013-11-16 23:38 MST, Daniel Richard G.
Details | Diff
Patch #2 against sudo hg tip (11.30 KB, patch)
2013-11-16 23:39 MST, Daniel Richard G.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Richard G. 2013-11-16 23:38:37 MST
Created attachment 383 [details]
Patch #1 against sudo hg tip

Building Sudo on Tru64 required some modifications. The major one was variadic macros (bug #621), but there were a handful of lesser changes needed.

The first patch attached here addresses the actual compile errors. One was a simple declaration-after-statement issue; the other was a more unusual situation where 'struct sockaddr' has an 'sa_len' field, but 'struct sockaddr_in' does not have 'sin_len'. The code was assuming that sa_len implied the existence of sin_len---which should be true, by all rights---yet doesn't always happen on this system, thanks to the inconsistent morass of feature test macros used to define the fields of those two structs.

The second patch addresses a handful of warnings that I noticed along the way, and problems similar to those:

* Numerous #if versus #ifdef mixups. Autoconf symbols are usually defined-or-not-defined, as opposed to zero-or-nonzero, and so should be checked using the latter or "#if defined()". (Incidentally, it may be good to add -Wundef to --enable-warnings; it would have caught many of these.)

* debug_return_str() et al. were using const qualifiers needlessly, which caused the compiler to complain when they are dropped in the return-statement cast

* Superfluous semicolon
Comment 1 Daniel Richard G. 2013-11-16 23:39:16 MST
Created attachment 384 [details]
Patch #2 against sudo hg tip
Comment 2 Todd C. Miller 2013-11-17 19:26:44 MST
The const in debug_return_str was not needless, it is required for fucntions that return const char *.  I've just added debug_return_const_str and debug_return_const_pty for those functions with a const return value which should solve the problem.

I've committed the other patches so hg tip should have the relevant changes now.
Comment 3 Daniel Richard G. 2013-11-17 23:19:47 MST
Hm, I think my compile options masked off the places that had const return values, as I didn't see warnings for those. But yes, having a separate macro for them is the way to go.

Thanks for getting these in!