Skip to content

Commit

Permalink
tcp-wrappers: drop libnsl2 build dependency
Browse files Browse the repository at this point in the history
The only libnsl2 function which is used by tcp-wrappers is
'yp_get_default_domain()'.  When USE_GETDOMAIN is set, this is
implemented as a simple wrapper around getdomainname() so that libnsl2
is not used at all.

We added a patch which does '#include <rpcsvc/ypclnt.h>' to avoid
implicit forward declaration.  By conditionalizing this, the libnsl2
dependency can be dropped completely.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  • Loading branch information
ensc authored and rpurdie committed Jan 3, 2024
1 parent c9c7ebd commit b013f6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -20,11 +20,16 @@ diff --git a/hosts_access.c b/hosts_access.c
index 0133e5e..58697ea 100644
--- a/hosts_access.c
+++ b/hosts_access.c
@@ -33,6 +33,7 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
@@ -33,6 +33,12 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
#endif
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <rpcsvc/ypclnt.h>
+#ifdef USE_GETDOMAIN
+/* defined in workarounds.c */
+extern int yp_get_default_domain(char **ptr);
+#else
+# include <rpcsvc/ypclnt.h>
+#endif /* USE_GETDOMAIN */
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
Expand Down
2 changes: 0 additions & 2 deletions meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
Expand Up @@ -7,8 +7,6 @@ SECTION = "console/network"
LICENSE = "BSD-1-Clause"
LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"

DEPENDS += "libnsl2"

PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
FILES:libwrap = "${base_libdir}/lib*${SOLIBS}"
FILES:libwrap-doc = "${mandir}/man3 ${mandir}/man5"
Expand Down

0 comments on commit b013f6c

Please sign in to comment.