Bugzilla – Bug 619
compat/getaddrinfo.o not added to LTLIBOBJS when needed (on HP-UX)
Last modified: 2013-11-13 08:36:38 MST
Building sudo 1.8.8 on HP-UX B.11.00 fails with libtool: link: cc -o sudo conversation.o env_hooks.o exec.o exec_common.o exec_pty.o get_pty.o hooks.o net_ifs.o load_plugins.o parse_args.o signal.o sudo.o sudo_edit.o tgetpass.o ttyname.o utmp.o preload.o ../plugins/sudoers/.libs/sudoers.a -lpam -lpthread ../common/.libs/libcommon.a ../compat/.libs/libreplace.a /usr/ccs/bin/ld: Unsatisfied symbols: freeaddrinfo (first referenced in ../plugins/sudoers/.libs/sudoers.a(sudoers.o)) (code) getaddrinfo (first referenced in ../plugins/sudoers/.libs/sudoers.a(sudoers.o)) (code) *** Error exit code 1 getaddrinfo() and freeaddrinfo() are defined in compat/getaddrinfo.c, but unlike other source files under compat/, this one is not compiled when the system lacks the corresponding functionality---because there is no AC_LIBOBJ(getaddrinfo) call anywhere in the configure script.
Created attachment 377 [details] Patch against sudo hg tip This patch fixes the problem and allows sudo to compile on systems lacking {get,free}addrinfo().
Committed, thanks.
getaddrinfo.lo has the "$(top_builddir)/config.h" dependency listed twice in compat/Makefile.in ...
The script that generates dependencies wasn't checking for duplicates. I've fixed that.
Created attachment 380 [details] Follow-up patch against sudo hg tip Only a couple further changes, attached, are needed to get Sudo building and testing correctly on the aforementioned HP-UX system.
Applied, thanks.
Oh, there's one more thing I forgot to mention: cc -c -I../../include -I.. -I. -I../../src -I../.. -D__STDC_WANT_LIB_EXT1__=1 -g +DAportable -Bhidden_def -D_REENTRANT -DLOCALEDIR=\"/usr/local/share/locale\" ../../src/exec.c cc: "../../src/exec.c", line 211: error 1588: "MSG_WAITALL" undefined. cc: "../../src/exec.c", line 211: warning 563: Argument #4 is not the correct type. *** Error exit code 1 On HP-UX, MSG_WAITALL exists, but it is not #defined unless you define the _XOPEN_SOURCE_EXTENDED feature test macro. So effectively, you can't build Sudo unless you #define that macro. (This is true for 11.00, 11.11, 11.31, and is likely true even for the latest kit.) I'm not sure what's the preferred way of handling this kind of thing, but there isn't even a mention of it in the OS-specific notes section of INSTALL. (I can file a new bug on this if appropriate.)
I just checked in changes to define _XOPEN_SOURCE_EXTENDED on HP-UX if needed.
Excellent. I tested the new configure-time logic, and it does the trick. I see you added something in case MSG_WAITALL is (really) missing, too. Everything looks good here, except for one final nit, in "make check". I get this error on the 11.00 system: check_symbols: test 7: able to resolve local symbol user_in_group check_symbols: 7 tests run, 1 errors, 85% success rate It doesn't happen on 11.11. Known issue?
That means that the symbol visibility controls are not working. It's a toolchain issue but it won't actually cause any problems.
Well, as long as that's not a fatal flaw security-wise :-) Todd, thank you for all your help on this bug. Please have a look at the others I've submitted when you have a chance!