From 604bbefca5aa56547130342ce7802cea801c044c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 1 Jan 2012 09:18:48 +0000 Subject: [PATCH] Migrate to Debian patchset which includes a lot more patches #158036 by Wolfram Schlich and #269833 by Jason. Tweak fix_options func definition #360749 by Alexander Kolesen. Add USE=netgroups so people can optionally enable @netgroups syntax. Add USE=static-libs support #378271 by Agostino Sarubbo. Package-Manager: portage-2.2.0_alpha81/cvs/Linux x86_64 --- sys-apps/tcp-wrappers/ChangeLog | 15 +- sys-apps/tcp-wrappers/Manifest | 28 +- .../files/tcp-wrappers-7.6-headers.patch | 295 ++++++++++++++++++ .../tcp-wrappers-7.6-redhat-bug11881.patch | 35 +++ sys-apps/tcp-wrappers/metadata.xml | 6 + .../tcp-wrappers/tcp-wrappers-7.6.22.ebuild | 86 +++++ 6 files changed, 461 insertions(+), 4 deletions(-) create mode 100644 sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch create mode 100644 sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch create mode 100644 sys-apps/tcp-wrappers/tcp-wrappers-7.6.22.ebuild diff --git a/sys-apps/tcp-wrappers/ChangeLog b/sys-apps/tcp-wrappers/ChangeLog index 54788bfc8de3..82ed1789d4b4 100644 --- a/sys-apps/tcp-wrappers/ChangeLog +++ b/sys-apps/tcp-wrappers/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-apps/tcp-wrappers -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/tcp-wrappers/ChangeLog,v 1.40 2010/10/08 02:20:06 leio Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/tcp-wrappers/ChangeLog,v 1.41 2012/01/01 09:18:48 vapier Exp $ + +*tcp-wrappers-7.6.22 (01 Jan 2012) + + 01 Jan 2012; Mike Frysinger +tcp-wrappers-7.6.22.ebuild, + +files/tcp-wrappers-7.6-headers.patch, + +files/tcp-wrappers-7.6-redhat-bug11881.patch, metadata.xml: + Migrate to Debian patchset which includes a lot more patches #158036 by + Wolfram Schlich and #269833 by Jason. Tweak fix_options func definition + #360749 by Alexander Kolesen. Add USE=netgroups so people can optionally + enable @netgroups syntax. Add USE=static-libs support #378271 by Agostino + Sarubbo. 08 Oct 2010; Mart Raudsepp tcp-wrappers-7.6-r8.ebuild: Drop to ~mips diff --git a/sys-apps/tcp-wrappers/Manifest b/sys-apps/tcp-wrappers/Manifest index 0579664964ff..057030a20994 100644 --- a/sys-apps/tcp-wrappers/Manifest +++ b/sys-apps/tcp-wrappers/Manifest @@ -1,6 +1,30 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX hosts.allow.example 585 RMD160 7bb172c17bad9ad17222e260cc87f66bd4522158 SHA1 61e199d6de88392e8d0c82d6f2269918670b8fc3 SHA256 fbcdcedbdc985d8f0cc79e9a8752e69553b48aa38662321046cd4eae9f4d7e3b +AUX tcp-wrappers-7.6-headers.patch 5419 RMD160 a54d2b36b81cc4355ec1823f0d2c99fe9cf92fff SHA1 821401cfffc67ef55846743d972d8a4359e8797e SHA256 86d24cdf5d1c7f88d21b174988234d5024f506982e029e173c06cb5456c46bb0 +AUX tcp-wrappers-7.6-redhat-bug11881.patch 956 RMD160 78ca802f6d8b9dfa6740e88d5817ff1e7840dad6 SHA1 2068acbe3cf99fe2811fdfb4fad3d691d657356c SHA256 b8b3bbbe223d3496b25070d1fbc62d9a1424709e20d380b55390b13f03b46e03 DIST tcp-wrappers-7.6-patches-1.0.tar.bz2 16128 RMD160 ff714d5d91d1d59ce7824859e66a2ad1b2f9c452 SHA1 b6ab8cac024c35429c7c1d50498b9e54a4740ca2 SHA256 dcb10f194684b16ae6aa9faf05dd8b063d81a3dde1431b664260dcf385089256 +DIST tcp-wrappers_7.6.q-22.debian.tar.gz 41730 RMD160 789ae5b220c854f80dfe2b9256618d5677729443 SHA1 dd8ae6f5a08e12b08fea56120689038c6bbd3c9a SHA256 0ff28337c5effe4f91e7ea43ddd65fc629c06922326f5ef2804f70943be64fb3 DIST tcp_wrappers_7.6.tar.gz 99438 RMD160 f592fec30f8b76ce8790182185dde709871095e0 SHA1 61689ec85b80f4ca0560aef3473eccd9e9e80481 SHA256 9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d EBUILD tcp-wrappers-7.6-r8.ebuild 1988 RMD160 b16fb3e4c7bb5587b971e6ecd60088e5a77366ac SHA1 1eb415b5a000e1f4646f9ae72b869f6206d865af SHA256 ecdf303617f21502705bc1aa0b3d9ec6854b4510c3b7b4d95665c9addf9351df -MISC ChangeLog 5881 RMD160 1f66911c814beda56459d40490a7688a3f631b0c SHA1 6e98b9c559afd76cb161874ce7707f0bbf8bba70 SHA256 f4ce04a6af2335839ab1b1b4bea16538474372b80d6b883a0916b54fb8b2a9f4 -MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 +EBUILD tcp-wrappers-7.6.22.ebuild 2427 RMD160 5e29e64591b22f153ea0cd1259a2c0b0cde0c4d4 SHA1 e1d5d81304756bec205c4cc5127b598fa54192ab SHA256 f3b9efbb99208f020cc3df4a167b1f41c35051ceda229c196e0078c527f7ca93 +MISC ChangeLog 6413 RMD160 28dcc8242dedb9764c8b101cccf329dc186cca21 SHA1 0701c37a1b5dba7f77e4d46cfc8bf4943af71b12 SHA256 621b2034974675e4b92530cf9742fc85e75f819ba3bca3611cb2b9795661e161 +MISC metadata.xml 349 RMD160 5fa738e3e8f3c0cf223d734f2bc92e35f07beb41 SHA1 d399e00c2fecda7638a5a10b4af4216157a712a0 SHA256 81a5bdc0c787284f58b68dd7e3db3cfe6652b336d03698826dd86a705626b725 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iQIcBAEBAgAGBQJPACT+AAoJELEHsLL7fEFWRN8P/1FrXJU2aRIoo5QWWcjMW715 +S1bnljcZ4Uuf14T6a9qD02nGMECK9j/VEXwo30tvvF3OEBFXgcNmcPHnY+xNTSZW +ja0e++WNiBknzQDsH3uuQLfLDymjaDqOGbT0SbYzX9a6aEzN+uGO1bo57l3Bu7B4 +cCbJfcljaJw7ZTTUS7V6n6yxvUi9+3/mcRiZFzG+WV028yOpxkT++OIxg/VUA+dc +DP/f3aYwVC9sRTanq3kFr6qfkgqn6Frxb5GT+UywjfjOTlM7hO9kwCKkl+ex4S7C +OE8y5momoebkbX9V7EOD7VhtAwoXTI99wrA1iZuCIazNq8kSbbSfDXchwgjmhqxp +GIXTQdP14vR8PbdFoDu2lARLx3bp12N2AX+JYn15dODfL2yastJTOP5UVIMamw5a +vNUGsGgTY0QMOObzbNNZbXLauO9y9rpVZAVxW1eD1tVkXC3Mbzf5oJ05CdjACxI+ +Q4/fLcvuK8FcTEkoPdT88hl94JG0I93f20Bp2Mj2w3PBAZ8VqiUdpLZjUxEaeYEk +4zaM9v3bHCl/n0atAPiM30E4JFjqgVkiOa3h7m0Qe906PWEI0A7kaKHNPvIjnP2M +oWLn/SYU93SbM895BgOn4oNNizN/rKHxfAywHg+qqk9JpOEr/2juyUxK0aCTrkmW +1oUO5G5dxAVWSaaz5wGz +=8lsf +-----END PGP SIGNATURE----- diff --git a/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch new file mode 100644 index 000000000000..328a4a102618 --- /dev/null +++ b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch @@ -0,0 +1,295 @@ +--- a/options.c ++++ b/options.c +@@ -34,6 +34,8 @@ + + /* System libraries. */ + ++#include ++#include + #include + #include + #include +--- a/safe_finger.c ++++ b/safe_finger.c +@@ -20,6 +20,11 @@ + + /* System libraries */ + ++#include ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -27,7 +31,7 @@ + #include + #include + +-extern void exit(); ++int pipe_stdin(char **argv); + + /* Local stuff */ + +--- a/scaffold.c ++++ b/scaffold.c +@@ -10,6 +10,7 @@ + + /* System libraries. */ + ++#include + #include + #include + #include +@@ -27,7 +27,4 @@ + #endif + +-#ifndef INET6 +-extern char *malloc(); +-#endif + + /* Application-specific. */ +--- a/shell_cmd.c ++++ b/shell_cmd.c +@@ -14,6 +14,10 @@ + + /* System libraries. */ + ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -25,8 +25,6 @@ + #include + #include + +-extern void exit(); +- + /* Local stuff. */ + + #include "tcpd.h" +--- a/tcpdchk.c ++++ b/tcpdchk.c +@@ -20,6 +20,8 @@ + + /* System libraries. */ + ++#include ++#include + #include + #include + #ifdef INET6 +@@ -35,10 +36,7 @@ + #include + #include + +-extern int errno; +-extern void exit(); +-extern int optind; +-extern char *optarg; ++int cidr_mask_addr(char *str); + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ +--- a/clean_exit.c ++++ b/clean_exit.c +@@ -13,8 +13,8 @@ + #endif + + #include +- +-extern void exit(); ++#include ++#include + + #include "tcpd.h" + +--- a/hosts_access.c ++++ b/hosts_access.c +@@ -23,6 +23,7 @@ + + /* System libraries. */ + ++#include + #include + #ifdef INT32_T + typedef uint32_t u_int32_t; +@@ -43,8 +44,8 @@ + #include + #endif + +-extern char *fgets(); +-extern int errno; ++static int match_pattern_ylo(const char *s, const char *pattern); ++int cidr_mask_addr(char *str); + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ +--- a/inetcf.c ++++ b/inetcf.c +@@ -9,15 +9,14 @@ + static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23"; + #endif + ++#include + #include + #include + #include + #include + #include + +-extern int errno; +-extern void exit(); +- ++#include "scaffold.h" + #include "tcpd.h" + #include "inetcf.h" + +--- a/percent_x.c ++++ b/percent_x.c +@@ -16,12 +16,12 @@ + + /* System libraries. */ + ++#include ++#include + #include + #include + #include + +-extern void exit(); +- + /* Local stuff. */ + + #include "tcpd.h" +--- a/rfc931.c ++++ b/rfc931.c +@@ -15,6 +15,7 @@ + + /* System libraries. */ + ++#include + #include + #include + #include +--- a/tcpd.c ++++ b/tcpd.c +@@ -16,6 +16,7 @@ + + /* System libraries. */ + ++#include + #include + #include + #include +@@ -39,6 +39,8 @@ + #include "patchlevel.h" + #include "tcpd.h" + ++void fix_options(struct request_info *request); ++ + int allow_severity = SEVERITY; /* run-time adjustable */ + int deny_severity = LOG_WARNING; /* ditto */ + +--- a/tcpdmatch.c ++++ b/tcpdmatch.c +@@ -19,6 +19,8 @@ + + /* System libraries. */ + ++#include ++#include + #include + #include + #include +@@ -30,9 +32,6 @@ + #include + #include + +-extern void exit(); +-extern int optind; +-extern char *optarg; + + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ +--- a/update.c ++++ b/update.c +@@ -19,6 +19,7 @@ + + /* System libraries */ + ++#include + #include + #include + #include +--- a/misc.c ++++ b/misc.c +@@ -14,11 +14,10 @@ + #include + #include + #include ++#include + + #include "tcpd.h" + +-extern char *fgets(); +- + #ifndef INADDR_NONE + #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ + #endif +--- a/fix_options.c ++++ b/fix_options.c +@@ -32,6 +32,7 @@ + + /* fix_options - get rid of IP-level socket options */ + ++void + fix_options(request) + struct request_info *request; + { +@@ -38,11 +38,8 @@ + #ifdef IP_OPTIONS + unsigned char optbuf[BUFFER_SIZE / 3], *cp; + char lbuf[BUFFER_SIZE], *lp; +-#ifdef __GLIBC__ +- size_t optsize = sizeof(optbuf), ipproto; +-#else +- int optsize = sizeof(optbuf), ipproto; +-#endif ++ socklen_t optsize = sizeof(optbuf); ++ int ipproto; + struct protoent *ip; + int fd = request->fd; + unsigned int opt; +--- a/socket.c ++++ b/socket.c +@@ -95,11 +95,7 @@ + static struct sockaddr_in client; + static struct sockaddr_in server; + #endif +-#ifdef __GLIBC__ +- size_t len; +-#else +- int len; +-#endif ++ socklen_t len; + char buf[BUFSIZ]; + int fd = request->fd; + +@@ -430,11 +426,7 @@ + #else + struct sockaddr_in sin; + #endif +-#ifdef __GLIBC__ +- size_t size = sizeof(sin); +-#else +- int size = sizeof(sin); +-#endif ++ socklen_t size; + + /* + * Eat up the not-yet received datagram. Some systems insist on a diff --git a/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch new file mode 100644 index 000000000000..4a6847621c57 --- /dev/null +++ b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch @@ -0,0 +1,35 @@ +--- tcp_wrappers_7.6/tcpd.c.bug11881 ++++ tcp_wrappers_7.6/tcpd.c +@@ -60,10 +60,10 @@ + */ + + if (argv[0][0] == '/') { +- strcpy(path, argv[0]); ++ strncpy(path, argv[0], sizeof(path)); + argv[0] = strrchr(argv[0], '/') + 1; + } else { +- sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]); ++ snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]); + } + + /* +--- tcp_wrappers_7.6/eval.c.bug11881 ++++ tcp_wrappers_7.6/eval.c +@@ -111,7 +111,7 @@ + return (hostinfo); + #endif + if (STR_NE(eval_user(request), unknown)) { +- sprintf(both, "%s@%s", request->user, hostinfo); ++ snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo); + return (both); + } else { + return (hostinfo); +@@ -128,7 +128,7 @@ + char *daemon = eval_daemon(request); + + if (STR_NE(host, unknown)) { +- sprintf(both, "%s@%s", daemon, host); ++ snprintf(both, sizeof(both), "%s@%s", daemon, host); + return (both); + } else { + return (daemon); diff --git a/sys-apps/tcp-wrappers/metadata.xml b/sys-apps/tcp-wrappers/metadata.xml index 96a2d586367d..1cecd60af1a0 100644 --- a/sys-apps/tcp-wrappers/metadata.xml +++ b/sys-apps/tcp-wrappers/metadata.xml @@ -2,4 +2,10 @@ base-system + + + Support matching NIS (host) netgroup names via the @netgroup syntax + (if you don't know what this means, you most likely need want it) + + diff --git a/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22.ebuild b/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22.ebuild new file mode 100644 index 000000000000..6c5a10a9167c --- /dev/null +++ b/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22.ebuild,v 1.1 2012/01/01 09:18:48 vapier Exp $ + +EAPI="4" + +inherit eutils toolchain-funcs versionator flag-o-matic + +MY_PV=$(get_version_component_range 1-2) +DEB_PV=$(get_version_component_range 3) +MY_P="${PN//-/_}_${MY_PV}" +DESCRIPTION="TCP Wrappers" +HOMEPAGE="ftp://ftp.porcupine.org/pub/security/index.html" +SRC_URI="ftp://ftp.porcupine.org/pub/security/${MY_P}.tar.gz + mirror://debian/pool/main/t/${PN}/${PN}_${MY_PV}.q-${DEB_PV}.debian.tar.gz" + +LICENSE="tcp_wrappers_license" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE="ipv6 netgroups static-libs" + +S=${WORKDIR}/${MY_P} + +src_prepare() { + EPATCH_OPTS="-p1" \ + epatch $(sed -e 's:^:../debian/patches/:' ../debian/patches/series) + epatch "${FILESDIR}"/${PN}-7.6-headers.patch + epatch "${FILESDIR}"/${PN}-7.6-redhat-bug11881.patch +} + +temake() { + emake \ + REAL_DAEMON_DIR=/usr/sbin \ + TLI= VSYSLOG= PARANOID= BUGS= \ + AUTH="-DALWAYS_RFC931" \ + AUX_OBJ="weak_symbols.o" \ + DOT="-DAPPEND_DOT" \ + HOSTNAME="-DALWAYS_HOSTNAME" \ + NETGROUP=$(usex netgroups -DNETGROUPS "") \ + STYLE="-DPROCESS_OPTIONS" \ + LIBS=$(usex netgroups -lnsl "") \ + LIB=$(usex static-libs libwrap.a "") \ + AR="$(tc-getAR)" ARFLAGS=rc \ + CC="$(tc-getCC)" \ + RANLIB="$(tc-getRANLIB)" \ + COPTS="${CFLAGS} ${CPPFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + "$@" || die +} + +src_configure() { + tc-export AR CC RANLIB + append-cppflags -DHAVE_WEAKSYMS -DHAVE_STRERROR -DSYS_ERRLIST_DEFINED + use ipv6 && append-cppflags -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len + temake config-check +} + +src_compile() { + temake all +} + +src_install() { + dosbin tcpd tcpdchk tcpdmatch safe_finger try-from || die + + doman *.[358] + dosym hosts_access.5 /usr/share/man/man5/hosts.allow.5 + dosym hosts_access.5 /usr/share/man/man5/hosts.deny.5 + + insinto /etc + newins "${FILESDIR}"/hosts.allow.example hosts.allow + + insinto /usr/include + doins tcpd.h + + into /usr + use static-libs && dolib.a libwrap.a + dolib.so shared/libwrap.so* + gen_usr_ldscript -a wrap + + dodoc BLURB CHANGES DISCLAIMER README* +} + +pkg_preinst() { + # don't clobber people with our default example config + [[ -e ${ROOT}/etc/hosts.allow ]] && cp -pP "${ROOT}"/etc/hosts.allow "${D}"/etc/hosts.allow +} -- 2.26.2