From 5a86073bd0f1fc561491faefaea1401367c2b97b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 18 Jan 2020 11:32:45 -0700 Subject: [PATCH] Portability fixes and correct path to hostcheck.h in MANIFEST. Include sys/socket.h for getpeername(). Link with -lnsl on Solaris to get inet_pton(). --- MANIFEST | 2 +- lib/iolog/Makefile.in | 2 +- lib/iolog/hostcheck.c | 2 +- plugins/sudoers/iolog.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MANIFEST b/MANIFEST index acb7a5f6d..9da1b9e05 100644 --- a/MANIFEST +++ b/MANIFEST @@ -77,9 +77,9 @@ include/compat/glob.h include/compat/nss_dbdefs.h include/compat/sha2.h include/compat/stdbool.h +include/hostcheck.h include/log_server.pb-c.h include/protobuf-c/protobuf-c.h -lib/iolog/hostcheck.h include/sudo_compat.h include/sudo_conf.h include/sudo_debug.h diff --git a/lib/iolog/Makefile.in b/lib/iolog/Makefile.in index 98f645e0b..bcdfb9fbd 100644 --- a/lib/iolog/Makefile.in +++ b/lib/iolog/Makefile.in @@ -119,7 +119,7 @@ Makefile: $(srcdir)/Makefile.in ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@ libsudo_iolog.la: $(LIBIOLOG_OBJS) - $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBIOLOG_OBJS) $(LT_LIBS) @ZLIB@ + $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBIOLOG_OBJS) $(LT_LIBS) @ZLIB@ @NET_LIBS@ check_iolog_path: $(CHECK_IOLOG_PATH_OBJS) libsudo_iolog.la $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(CHECK_IOLOG_PATH_OBJS) libsudo_iolog.la $(ASAN_LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(TEST_LDFLAGS) $(TEST_LIBS) diff --git a/lib/iolog/hostcheck.c b/lib/iolog/hostcheck.c index b7fcb2a57..8fde618a0 100644 --- a/lib/iolog/hostcheck.c +++ b/lib/iolog/hostcheck.c @@ -358,4 +358,4 @@ validate_hostname(const X509 *cert, const char *hostname, const char *ipaddr, in return res; } -#endif /* HAVE_OPENSSL */ \ No newline at end of file +#endif /* HAVE_OPENSSL */ diff --git a/plugins/sudoers/iolog.c b/plugins/sudoers/iolog.c index 3f34956b1..9c54eccec 100644 --- a/plugins/sudoers/iolog.c +++ b/plugins/sudoers/iolog.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include