diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-05-05 04:55:32 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-05-05 04:55:32 +0000 |
commit | 30558f28d0df839d2cd7952ee1ee9a1de529a397 (patch) | |
tree | 6178c6eff1b46fbec75b11a30515971d1f329660 /net-misc | |
parent | old (diff) | |
download | gentoo-2-30558f28d0df839d2cd7952ee1ee9a1de529a397.tar.gz gentoo-2-30558f28d0df839d2cd7952ee1ee9a1de529a397.tar.bz2 gentoo-2-30558f28d0df839d2cd7952ee1ee9a1de529a397.zip |
Version bump #219498 by Conrad Kostecki.
(Portage version: 2.2_pre5)
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/whois/ChangeLog | 8 | ||||
-rw-r--r-- | net-misc/whois/files/whois-4.7.26-gentoo-security.patch | 79 | ||||
-rw-r--r-- | net-misc/whois/whois-4.7.26.ebuild | 53 |
3 files changed, 139 insertions, 1 deletions
diff --git a/net-misc/whois/ChangeLog b/net-misc/whois/ChangeLog index 160947e6be5a..50386d1b2d33 100644 --- a/net-misc/whois/ChangeLog +++ b/net-misc/whois/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/whois # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/whois/ChangeLog,v 1.106 2008/01/08 14:32:49 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/whois/ChangeLog,v 1.107 2008/05/05 04:55:32 vapier Exp $ + +*whois-4.7.26 (05 May 2008) + + 05 May 2008; Mike Frysinger <vapier@gentoo.org> + +files/whois-4.7.26-gentoo-security.patch, +whois-4.7.26.ebuild: + Version bump #219498 by Conrad Kostecki. 08 Jan 2008; Jeroen Roovers <jer@gentoo.org> whois-4.7.24.ebuild: Stable for HPPA (bug #202595). diff --git a/net-misc/whois/files/whois-4.7.26-gentoo-security.patch b/net-misc/whois/files/whois-4.7.26-gentoo-security.patch new file mode 100644 index 000000000000..9757604bde13 --- /dev/null +++ b/net-misc/whois/files/whois-4.7.26-gentoo-security.patch @@ -0,0 +1,79 @@ +--- whois-4.7.26/whois.c ++++ whois-4.7.26/whois.c +@@ -87,7 +87,7 @@ + /* RIPE flags */ + if (strchr(ripeflags, ch)) { + for (p = fstring; *p; p++); +- sprintf(p--, "-%c ", ch); ++ snprintf(p--, sizeof(fstring), "-%c ", ch); + continue; + } + if (strchr(ripeflagsp, ch)) { +@@ -141,10 +141,10 @@ + while (1) { + qslen += strlen(*argv) + 1 + 1; + qstring = realloc(qstring, qslen); +- strcat(qstring, *argv++); ++ strncat(qstring, *argv++, qslen-1); + if (argc == 1) + break; +- strcat(qstring, " "); ++ strncat(qstring, " ", qslen-1); + argc--; + } + } +@@ -467,8 +467,10 @@ + char *buf, *p; + int i, isripe = 0; + ++ /* buflen was always 0 in original patch and buf was allocated twice /Aye */ + /* 64 bytes reserved for server-specific flags added later */ +- buf = malloc(strlen(flags) + strlen(query) + strlen(client_tag) + 64); ++ int buflen = strlen(flags) + strlen(query) + strlen(client_tag) + 64; ++ buf = malloc(buflen); + *buf = '\0'; + for (i = 0; ripe_servers[i]; i++) + if (streq(server, ripe_servers[i])) { +@@ -481,7 +483,7 @@ + if (*flags) { + if (!isripe && !streq(server, "whois.corenic.net")) + puts(_("Warning: RIPE flags used with a traditional server.")); +- strcat(buf, flags); ++ strncat(buf, flags, buflen-1); + } + + #ifdef HAVE_LIBIDN +@@ -490,28 +492,28 @@ + */ + if (streq(server, "whois.denic.de") && domcmp(query, ".de") + && !strchr(query, ' ') && !*flags) +- sprintf(buf, "-T dn,ace -C US-ASCII %s", query); ++ snprintf(buf, buflen-1, "-T dn,ace -C US-ASCII %s", query); + else + /* here we have another registrar who could not make things simple + * -C sets the language for both input and output + */ + if (!isripe && streq(server, "whois.cat") && domcmp(query, ".cat") + && !strchr(query, ' ')) +- sprintf(buf, "-C US-ASCII ace %s", query); ++ snprintf(buf, buflen-1, "-C US-ASCII ace %s", query); + else + #endif + if (!isripe && (streq(server, "whois.nic.mil") || + streq(server, "whois.nic.ad.jp")) && + strncaseeq(query, "AS", 2) && isasciidigit(query[2])) + /* FIXME: /e is not applied to .JP ASN */ +- sprintf(buf, "AS %s", query + 2); /* fix query for DDN */ ++ snprintf(buf, buflen-1, "AS %s", query + 2); /* fix query for DDN */ + else if (!isripe && (streq(server, "whois.nic.ad.jp") || + streq(server, "whois.jprs.jp"))) { + char *lang = getenv("LANG"); /* not a perfect check, but... */ + if (!lang || !strneq(lang, "ja", 2)) +- sprintf(buf, "%s/e", query); /* ask for english text */ ++ snprintf(buf, buflen-1, "%s/e", query); /* ask for english text */ + else +- strcat(buf, query); ++ strncat(buf, query, buflen-1); + } else if (!isripe && streq(server, "whois.arin.net") && + (p = strrchr(query, '/'))) { + strncat(buf, query, p - query); /* strip CIDR */ diff --git a/net-misc/whois/whois-4.7.26.ebuild b/net-misc/whois/whois-4.7.26.ebuild new file mode 100644 index 000000000000..adae4b288707 --- /dev/null +++ b/net-misc/whois/whois-4.7.26.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/whois/whois-4.7.26.ebuild,v 1.1 2008/05/05 04:55:32 vapier Exp $ + +inherit eutils toolchain-funcs + +MY_P=${P/-/_} +DESCRIPTION="improved Whois Client" +HOMEPAGE="http://www.linux.it/~md/software/" +SRC_URI="mirror://debian/pool/main/w/whois/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="nls" +RESTRICT="test" #59327 + +RDEPEND="net-dns/libidn" +DEPEND="${RDEPEND} + >=dev-lang/perl-5" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-4.7.26-gentoo-security.patch + epatch "${FILESDIR}"/${PN}-4.7.2-config-file.patch + + if use nls ; then + cd po + sed -i -e "s:/usr/bin/install:install:" Makefile + else + sed -i -e '/ENABLE_NLS/s:define:undef:' config.h + sed -i -e "s:cd po.*::" Makefile + fi +} + +src_compile() { + tc-export CC + emake OPTS="${CFLAGS}" HAVE_LIBIDN=1 || die +} + +src_install() { + dodir /usr/bin /usr/share/man/man1 + make BASEDIR="${D}" prefix=/usr install || die + insinto /etc + doins whois.conf + dodoc README + + if [[ "${USERLAND}" != "GNU" ]]; then + mv "${D}"/usr/share/man/man1/{whois,mdwhois}.1 + mv "${D}"/usr/bin/{whois,mdwhois} + fi +} |