OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 01-Apr-2004 14:14:30 Branch: HEAD Handle: 2004040113142900 Modified files: openpkg-src/tcpwrappers tcpwrappers.patch tcpwrappers.spec Log: 1) Steve Grubb changed the name of a number of external library definitions to avoid namespace collisions. E.g., by default his code defines tcpd_sock_host instead of sock_host, and tcpd_eval_client instead of eval_client. Since the ORBit package is looking for the traditional function names, it fails to link with Grubb's default libwrap.a. So I added an option to the spec file called "with_private_namespace", which defaults to "no" so that the traditional lib defs are created by default. Setting the option to "yes" creates the new private definitions. This change also required a change to the patch file because Steve had apparently forgotten to include "sock_host" in the list of methods that need to be optionally publicized. 2) Matthias Kurz's patch to run under Solaris changed the name of the local my_setenv() function to setenv(). The ORBit package objects to this because it does not want to link with a tcpwrappers that has setenv() built in. (I'm not sure why this is since Solaris by default does not have a setenv() function, which is why tcpwrappers conditionally includes one.) However, the way to make ORBit happy is to leave my_setenv() alone and to conditionally redefine the call to setenv() in options.c to be a call to my_setenv() on systems that need the local definition of this function. That way any other external packages that are fussy about this will not complain. These changes are also present in this package. Submitted by: Dennis McRitchie Summary: Revision Changes Path 1.2 +244 -17 openpkg-src/tcpwrappers/tcpwrappers.patch 1.5 +7 -1 openpkg-src/tcpwrappers/tcpwrappers.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/tcpwrappers/tcpwrappers.patch ============================================================================ $ cvs diff -u -r1.1 -r1.2 tcpwrappers.patch --- openpkg-src/tcpwrappers/tcpwrappers.patch 21 Oct 2003 10:09:13 -0000 1.1 +++ openpkg-src/tcpwrappers/tcpwrappers.patch 1 Apr 2004 12:14:29 -0000 1.2 @@ -1,6 +1,10 @@ Index: Makefile ---- Makefile.orig 2003-01-03 19:52:40.000000000 +0100 -+++ Makefile 2003-10-21 12:08:03.000000000 +0200 +=================================================================== +RCS file: /cvs/opkg/vendor_stuff/tcpwrappers/Makefile,v +retrieving revision 1.1.1.1 +diff -u -u -r1.1.1.1 Makefile +--- Makefile 3 Jan 2003 18:52:40 -0000 1.1.1.1 ++++ Makefile 11 Nov 2003 00:18:26 -0000 @@ -128,12 +128,12 @@ 386bsd netbsd bsdos: @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ @@ -16,21 +20,32 @@ linux: @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ -Index: tcpd.h ---- tcpd.h.orig 2003-01-05 02:15:59.000000000 +0100 -+++ tcpd.h 2003-10-21 12:08:03.000000000 +0200 -@@ -7,6 +7,8 @@ - #ifndef TCP_WRAPPERS_HEADER - #define TCP_WRAPPERS_HEADER +@@ -183,11 +183,15 @@ -+#include <sys/types.h> -+#include <sys/socket.h> - #include <netinet/in.h> - #include <netdb.h> + # SunOS 5.x is another SYSV4 variant. + sunos5: +- @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ +- LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \ ++ @case `uname -r` in \ ++ 5.6) RTLIB="-lposix4";; \ ++ *) RTLIB="-lrt";; \ ++ esac; \ ++ make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ ++ LIBS="-lsocket -lnsl $$RTLIB" RANLIB=echo ARFLAGS=rv VSYSLOG= \ + NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \ + BUGS="$(BUGS)" all \ +- EXTRA_CFLAGS=-DNEED_SETENV ++ EXTRA_CFLAGS="-DNEED_SETENV -DNEED_GETOPT" + # Generic SYSV40 + esix sysv4: Index: fix_options.c ---- fix_options.c.orig 2003-01-05 02:27:10.000000000 +0100 -+++ fix_options.c 2003-10-21 12:08:31.000000000 +0200 +=================================================================== +RCS file: /cvs/opkg/vendor_stuff/tcpwrappers/fix_options.c,v +retrieving revision 1.1.1.1 +diff -u -u -r1.1.1.1 fix_options.c +--- fix_options.c 5 Jan 2003 01:27:10 -0000 1.1.1.1 ++++ fix_options.c 11 Nov 2003 00:18:26 -0000 @@ -47,7 +47,14 @@ clean_exit(request); } @@ -80,9 +95,166 @@ } lp = lbuf; -Index: internal.h ---- internal.h.orig 2003-01-05 00:37:53.000000000 +0100 -+++ internal.h 2003-10-21 12:08:03.000000000 +0200 +Index: tli.c +=================================================================== +RCS file: /cvs/opkg/vendor_stuff/tcpwrappers/tli.c,v +retrieving revision 1.1.1.1 +diff -u -u -r1.1.1.1 tli.c +--- tli.c 2 Sep 2002 12:47:03 -0000 1.1.1.1 ++++ tli.c 11 Nov 2003 00:18:26 -0000 +@@ -77,13 +77,13 @@ + tli_endpoints(request); + if ((request->config = tli_transport(request->fd)) != 0 + && STR_EQ(request->config->nc_protofmly, "inet")) { +- if (request->client->unit != 0) { +- client = *(struct sockaddr_in *) request->client->unit->addr.buf; +- request->client->sin = &client; ++ if (request->client.unit != 0) { ++ client = *(struct sockaddr_in *) request->client.unit->addr.buf; ++ request->client.au.sa_in = client; + } +- if (request->server->unit != 0) { +- server = *(struct sockaddr_in *) request->server->unit->addr.buf; +- request->server->sin = &server; ++ if (request->server.unit != 0) { ++ server = *(struct sockaddr_in *) request->server.unit->addr.buf; ++ request->server.au.sa_in = server; + } + tli_cleanup(request); + sock_methods(request); +@@ -100,10 +100,10 @@ + { + if (request->config != 0) + freenetconfigent(request->config); +- if (request->client->unit != 0) +- t_free((char *) request->client->unit, T_UNITDATA); +- if (request->server->unit != 0) +- t_free((char *) request->server->unit, T_UNITDATA); ++ if (request->client.unit != 0) ++ t_free((char *) request->client.unit, T_UNITDATA); ++ if (request->server.unit != 0) ++ t_free((char *) request->server.unit, T_UNITDATA); + } + + /* tli_endpoints - determine TLI client and server endpoint information */ +@@ -140,7 +140,7 @@ + return; + } + } +- request->client->unit = client; ++ request->client.unit = client; + + /* + * Look up the server endpoint address. This can be used for filtering on +@@ -156,7 +156,7 @@ + t_free((void *) server, T_UNITDATA); + return; + } +- request->server->unit = server; ++ request->server.unit = server; + } + + /* tli_transport - find out TLI transport type */ +--- socket.c.orig 2003-03-10 11:05:21.000000000 -0500 ++++ socket.c 2004-03-19 13:57:56.518575000 -0500 +@@ -39,9 +39,9 @@ + static void sock_sink(int); + + /* +- * tcpd_sock_host - look up endpoint addresses and install conversion methods ++ * sock_host - look up endpoint addresses and install conversion methods + */ +-void tcpd_sock_host(struct request_info *request) ++void sock_host(struct request_info *request) + { + int len; + char buf[BUFSIZ]; +@@ -135,17 +135,31 @@ + sizeof(host->name), 0, 0, NI_NAMEREQD | NI_NOFQDN) == 0) + { + struct addrinfo hints, *res, *ressave; ++ struct in_addr v4addr; + int ret_val; + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_socktype = SOCK_STREAM; +- hints.ai_family = ADDR_FAM(tsa); ++ if (ADDR_FAM(tsa) == AF_INET) ++ { ++ hints.ai_family = AF_INET; ++ memcpy(&v4addr, &SAIN(tsa)->sin_addr, sizeof(struct in_addr)); ++ } ++ else /* only AF_INET6 left, currently */ ++ { ++ if (IN6_IS_ADDR_V4MAPPED(&tsa->sa_in6.sin6_addr)) { ++ IN6_V4MAPPED_TO_INADDR(&tsa->sa_in6.sin6_addr, &v4addr); ++ hints.ai_family = AF_INET; ++ } ++ else ++ hints.ai_family = AF_INET6; ++ } + + /* + * And then a forward lookup on what was returned. + */ +- if( (ret_val = getaddrinfo(host->name, NULL, &hints, &res)) < 0 ) ++ if( (ret_val = getaddrinfo(host->name, NULL, &hints, &res)) != 0 ) + { + tcpd_warn("can't verify hostname: getaddrinfo(%s) failed - %s", + host->name, gai_strerror(ret_val)); +@@ -185,11 +199,14 @@ + */ + while (res) + { +- if (tsa->sa.sa_family != res->ai_family) +- continue; ++ if (res->ai_family != hints.ai_family) { ++ /* can this happen ??? */ ++ res = res->ai_next; ++ continue; ++ } + if (res->ai_family == AF_INET) + { +- if (memcmp(&SAIN(tsa)->sin_addr, ++ if (memcmp(&v4addr, + &SAIN(res->ai_addr)->sin_addr, + sizeof(struct in_addr)) == 0) + { +--- fromhost.c.orig 2002-12-23 12:45:44.000000000 -0500 ++++ fromhost.c 2004-03-19 14:21:18.786257000 -0500 +@@ -44,7 +44,7 @@ + if (ioctl(request->fd, I_FIND, "timod") > 0) { + tli_host(request); + } else { +- tcpd_sock_host(request); ++ sock_host(request); + } + } + +--- namespace.h.orig 2002-12-23 12:55:57.000000000 -0500 ++++ namespace.h 2004-03-29 15:03:24.885659000 -0500 +@@ -39,6 +39,7 @@ + #define percent_x tcpd_percent_x + #define rfc931 tcpd_rfc931 + #define shell_cmd tcpd_shell_cmd ++#define sock_host tcpd_sock_host + #define sock_hostaddr tcpd_sock_hostaddr + #define sock_hostname tcpd_sock_hostname + #define tli_host tcpd_tli_host +@@ -47,4 +48,10 @@ + + #endif + ++#ifdef NEED_SETENV ++ ++#define setenv my_setenv ++ ++#endif ++ + #endif +--- internal.h.orig 2003-01-04 18:37:53.000000000 -0500 ++++ internal.h 2004-03-23 12:46:22.000000000 -0500 @@ -7,6 +7,7 @@ #ifndef IMPL_HEADER #define IMPL_HEADER @@ -91,3 +263,58 @@ #include <sys/socket.h> #include <stdio.h> #include <string.h> +@@ -20,6 +21,12 @@ + #define SAIN6( p ) ( (struct sockaddr_in6 *) (p) ) + #define ADDR_FAM( p ) ( (p)->sa.sa_family ) + ++/* Convert IPv4 address that was mapped to an IPv6 address back to IPv4 */ ++#ifndef IN6_V4MAPPED_TO_INADDR ++#define IN6_V4MAPPED_TO_INADDR(v6, v4) \ ++ memcpy(v4, ((char *)v6) + 12, sizeof(struct in_addr)); ++#endif ++ + /* Common string operations. Less clutter should be more readable. */ + + #define STRN_CPY(d,s,l) { strncpy((d),(s),(l)); (d)[(l)-1] = 0; } +@@ -106,7 +113,7 @@ + /* Socket-specific methods, including DNS hostname lookups. */ + + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) +-extern void tcpd_sock_host(struct request_info *);/* look up endpoint addr'es */ ++extern void sock_host(struct request_info *);/* look up endpoint addr'es */ + #endif + extern void sock_hostname(struct host_info *);/* xlate address to hostname */ + extern void sock_hostaddr(struct host_info *);/* address to printable address */ +--- ptx.c.orig 2002-12-23 12:46:22.000000000 -0500 ++++ ptx.c 2004-03-23 12:50:51.000000000 -0500 +@@ -70,7 +70,7 @@ + + if (SWAP_MODULE(request->fd, "timod", "sockmod") != 0) + tcpd_warn("replace timod by sockmod: %m"); +- tcpd_sock_host(request); ++ sock_host(request); + if (SWAP_MODULE(request->fd, "sockmod", "timod") != 0) + tcpd_warn("replace sockmod by timod: %m"); + if (request->sink != 0) +--- tcpd.h.orig 2003-01-04 20:15:59.000000000 -0500 ++++ tcpd.h 2004-03-23 12:57:47.000000000 -0500 +@@ -7,6 +7,8 @@ + #ifndef TCP_WRAPPERS_HEADER + #define TCP_WRAPPERS_HEADER + ++#include <sys/types.h> ++#include <sys/socket.h> + #include <netinet/in.h> + #include <netdb.h> + +@@ -70,8 +72,8 @@ + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) + void fromhost(struct request_info *); /* get/validate client host info */ + #else +-#define fromhost tcpd_sock_host /* no TLI support needed */ +-extern void tcpd_sock_host(struct request_info *);/* look up endpoint addr'es */ ++#define fromhost sock_host /* no TLI support needed */ ++extern void sock_host(struct request_info *);/* look up endpoint addr'es */ + #endif + + /* @@ . patch -p0 <<'@@ .' Index: openpkg-src/tcpwrappers/tcpwrappers.spec ============================================================================ $ cvs diff -u -r1.4 -r1.5 tcpwrappers.spec --- openpkg-src/tcpwrappers/tcpwrappers.spec 7 Feb 2004 17:59:13 -0000 1.4 +++ openpkg-src/tcpwrappers/tcpwrappers.spec 1 Apr 2004 12:14:29 -0000 1.5 @@ -34,7 +34,10 @@ Group: Network License: BSD Version: 7.6k -Release: 20040207 +Release: 20040401 + +# package options +%option with_private_namespace no # list of sources Source0: http://www.web-insights.net/socket_wrappers/socket_wrappers-%{version}.tar.gz @@ -90,6 +93,9 @@ esac %{l_make} %{l_mflags} \ $platform \ +%if "%{with_private_namespace}" != "yes" + NAMESPACE="" \ +%endif CC="%{l_cc} %{l_cflags -O}" %install @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]