summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Holzer <mholzer@gentoo.org>2003-11-23 00:04:07 +0000
committerMartin Holzer <mholzer@gentoo.org>2003-11-23 00:04:07 +0000
commit47b338626b970baf1b5c0b20b5136f126730a3aa (patch)
tree9926e5d1f4f5b5d1525fda9b38c38725c90b09dc /net-misc/whois
parentVersion bumped. Closes #34109. (diff)
downloadgentoo-2-47b338626b970baf1b5c0b20b5136f126730a3aa.tar.gz
gentoo-2-47b338626b970baf1b5c0b20b5136f126730a3aa.tar.bz2
gentoo-2-47b338626b970baf1b5c0b20b5136f126730a3aa.zip
Version bumped. Closes #34109.
Diffstat (limited to 'net-misc/whois')
-rw-r--r--net-misc/whois/ChangeLog8
-rw-r--r--net-misc/whois/Manifest5
-rw-r--r--net-misc/whois/files/digest-whois-4.6.81
-rw-r--r--net-misc/whois/files/whois-4.6.8-gentoo-security.patch158
-rw-r--r--net-misc/whois/whois-4.6.8.ebuild51
5 files changed, 220 insertions, 3 deletions
diff --git a/net-misc/whois/ChangeLog b/net-misc/whois/ChangeLog
index a29ef1a94789..fa2499f91626 100644
--- a/net-misc/whois/ChangeLog
+++ b/net-misc/whois/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/whois
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/whois/ChangeLog,v 1.26 2003/11/22 02:15:03 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/whois/ChangeLog,v 1.27 2003/11/23 00:04:02 mholzer Exp $
+
+*whois-4.6.8 (23 Nov 2003)
+
+ 23 Nov 2003; Martin Holzer <mholzer@gentoo.org> whois-4.6.8.ebuild,
+ files/whois-4.6.8-gentoo-security.patch:
+ Version bumped. Closes #34109.
21 Nov 2003; Aron Griffis <agriffis@gentoo.org> whois-4.6.6-r2.ebuild:
Stable on alpha
diff --git a/net-misc/whois/Manifest b/net-misc/whois/Manifest
index bf8817656b91..3bfca1b24e8f 100644
--- a/net-misc/whois/Manifest
+++ b/net-misc/whois/Manifest
@@ -1,6 +1,7 @@
-MD5 acfee5d633b8cbfd77388c3ce3544f65 whois-4.6.8.ebuild 1205
-MD5 82f60c193caf8d78a6957b3ec0bd0143 ChangeLog 4481
+MD5 494db4b3f0d36d6cead1fe4d2a9c6a65 whois-4.6.8.ebuild 1199
+MD5 fb48577509884ec816247cfa3748eb32 ChangeLog 4655
MD5 14f61101e310b129373e01ad2fb759a6 whois-4.6.6-r2.ebuild 1183
+MD5 54ba3bae8b15b96af12a1316c25fdaae files/whois-4.6.8-gentoo-security.patch 4540
MD5 7969ff7f79c3b277b2306a636a8dc44a files/digest-whois-4.6.8 62
MD5 9d6a7c447cdafb5e2b97f86d5c6e9789 files/digest-whois-4.6.6-r2 62
MD5 5b0f12c560d041d865109694432ffd93 files/whois-4.6.6-gentoo-security-2.patch 5366
diff --git a/net-misc/whois/files/digest-whois-4.6.8 b/net-misc/whois/files/digest-whois-4.6.8
new file mode 100644
index 000000000000..85f10e340ab9
--- /dev/null
+++ b/net-misc/whois/files/digest-whois-4.6.8
@@ -0,0 +1 @@
+MD5 c318f9a35d845df1c5804cdef2041cff whois_4.6.8.tar.gz 47376
diff --git a/net-misc/whois/files/whois-4.6.8-gentoo-security.patch b/net-misc/whois/files/whois-4.6.8-gentoo-security.patch
new file mode 100644
index 000000000000..5f92105cf501
--- /dev/null
+++ b/net-misc/whois/files/whois-4.6.8-gentoo-security.patch
@@ -0,0 +1,158 @@
+--- whois.c.orig 2003-09-10 01:21:52.000000000 +0200
++++ whois.c 2003-11-23 01:51:20.000000000 +0100
+@@ -73,7 +73,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)) {
+@@ -86,7 +86,7 @@
+ /* program flags */
+ switch (ch) {
+ case 'h':
+- server = q = malloc(strlen(optarg) + 1);
++ server = q = xmalloc(strlen(optarg) + 1);
+ for (p = optarg; *p && *p != ':'; *q++ = tolower(*p++));
+ if (*p == ':')
+ port = p + 1;
+@@ -122,7 +122,7 @@
+ usage();
+
+ /* On some systems realloc only works on non-NULL buffers */
+- qstring = malloc(64);
++ qstring = xmalloc(64);
+ *qstring = '\0';
+
+ /* parse other parameters, if any */
+@@ -131,11 +131,11 @@
+
+ while (1) {
+ qslen += strlen(*argv) + 1 + 1;
+- qstring = realloc(qstring, qslen);
+- strcat(qstring, *argv++);
++ qstring = xrealloc(qstring, qslen);
++ strncat(qstring, *argv++, qslen-1);
+ if (argc == 1)
+ break;
+- strcat(qstring, " ");
++ strncat(qstring, " ", qslen);
+ argc--;
+ }
+ }
+@@ -401,10 +401,12 @@
+ {
+ char *buf;
+ int i, isripe = 0;
++ int buflen = 0;
+
+ /* +2 for \r\n; +1 for NULL */
+- buf = malloc(strlen(flags) + strlen(query) + strlen(client_tag) + 4
+- + 2 + 1);
++ buf = malloc(strlen(flags) + strlen(query) + strlen(client_tag) + 4 + 2 + 1);
++ buf = xmalloc(buflen);
++
+ *buf = '\0';
+ for (i = 0; ripe_servers[i]; i++)
+ if (strcmp(server, ripe_servers[i]) == 0) {
+@@ -426,21 +428,21 @@
+ if (*flags) {
+ if (!isripe && strcmp(server, "whois.corenic.net") != 0)
+ puts(_("Warning: RIPE flags used with a traditional server."));
+- strcat(buf, flags);
++ strncat(buf, flags, buflen);
+ }
+ /* FIXME: /e is not applied to .JP ASN */
+ if (!isripe && (strcmp(server, "whois.nic.mil") == 0 ||
+ strcmp(server, "whois.nic.ad.jp") == 0) &&
+ strncasecmp(query, "AS", 2) == 0 && isasciidigit(query[2]))
+- sprintf(buf, "AS %s", query + 2); /* fix query for DDN */
++ snprintf(buf, buflen, "AS %s", query + 2); /* fix query for DDN */
+ else if (!isripe && strcmp(server, "whois.nic.ad.jp") == 0) {
+ char *lang = getenv("LANG"); /* not a perfect check, but... */
+ if (!lang || (strncmp(lang, "ja", 2) != 0))
+- sprintf(buf, "%s/e", query); /* ask for english text */
++ snprintf(buf, buflen, "%s/e", query); /* ask for english text */
+ else
+- strcat(buf, query);
++ strncat(buf, query, buflen);
+ } else
+- strcat(buf, query);
++ strncat(buf, query, buflen);
+ return buf;
+ }
+
+@@ -483,7 +485,7 @@
+
+ if (verb)
+ printf(_("Detected referral to %s on %s.\n"), nq, nh);
+- strcat(nq, "\r\n");
++ strncat(nq, "\r\n", sizeof(nq));
+ fd = openconn(nh, np);
+ do_query(fd, nq);
+ continue;
+@@ -509,7 +511,7 @@
+ FILE *fi;
+ int state = 0;
+
+- temp = malloc(strlen(query) + 1 + 2 + 1);
++ temp = xmalloc(strlen(query) + 1 + 2 + 1);
+ *temp = '=';
+ strcpy(temp + 1, query);
+ strcat(temp, "\r\n");
+@@ -527,7 +529,7 @@
+
+ for (p = buf; *p != ':'; p++); /* skip until colon */
+ for (p++; *p == ' '; p++); /* skip colon and spaces */
+- ret = malloc(strlen(p) + 1);
++ ret = xmalloc(strlen(p) + 1);
+ for (q = ret; *p != '\n' && *p != '\r' && *p != ' '; *q++ = *p++)
+ ; /*copy data*/
+ *q = '\0';
+@@ -572,7 +574,7 @@
+ for (p = buf; *p != ':'; p++); /* skip until colon */
+ for (p++; *p != ':'; p++); /* skip until 2nd colon */
+ for (p++; *p == ' '; p++); /* skip colon and spaces */
+- ret = malloc(strlen(p) + 1);
++ ret = xmalloc(strlen(p) + 1);
+ for (q = ret; *p != '\n' && *p != '\r'; *q++ = *p++); /*copy data*/
+ *q = '\0';
+ state = 2;
+@@ -726,6 +728,24 @@
+ exit(0);
+ }
+
++/* Memory allocation routines */
++void *xmalloc(size_t size)
++{
++ void *ptr;
++
++ if ((ptr = malloc(size)) == NULL)
++ err_sys("malloc");
++
++ return ptr;
++}
++
++void *xrealloc(void *ptr, size_t size)
++{
++ if ((ptr = realloc(ptr, size)) == NULL)
++ err_sys("realloc");
++
++ return ptr;
++}
+
+ /* Error routines */
+ void err_sys(const char *fmt, ...)
+--- whois.h.orig 2003-11-23 01:58:01.000000000 +0100
++++ whois.h 2003-11-23 01:58:52.000000000 +0100
+@@ -23,6 +23,8 @@
+ int domfind(const char *, const char *[]);
+ char *normalize_domain(const char *);
+
++void *xmalloc(size_t);
++void *xrealloc(void *, size_t);
+ void err_quit(const char *,...);
+ void err_sys(const char *,...);
+
diff --git a/net-misc/whois/whois-4.6.8.ebuild b/net-misc/whois/whois-4.6.8.ebuild
new file mode 100644
index 000000000000..bcd8de15d062
--- /dev/null
+++ b/net-misc/whois/whois-4.6.8.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/whois/whois-4.6.8.ebuild,v 1.1 2003/11/23 00:04:02 mholzer Exp $
+
+IUSE="nls"
+MY_P=${P/-/_}
+DESCRIPTION="improved Whois Client"
+SRC_URI="http://www.linux.it/~md/software/${MY_P}.tar.gz"
+HOMEPAGE="http://www.linux.it/~md/software/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~hppa ~arm ~ia64 ~alpha"
+
+DEPEND=">=sys-apps/sed-4
+ >=dev-lang/perl-5"
+RDEPEND="virtual/glibc"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ sed -i -e "s/-O2/$CFLAGS/" Makefile
+
+ use nls && ( \
+ cd po
+ sed -i -e "s:/usr/bin/install:/bin/install:" Makefile
+ ) || ( \
+ sed -i -e "s:cd po.*::" Makefile
+ )
+
+ epatch ${FILESDIR}/${P}-gentoo-security.patch || die
+}
+
+src_compile() {
+ make || die
+ make mkpasswd || die
+}
+
+src_install() {
+ dodir /usr/bin
+ dodir /usr/share/man/man1
+ use nls && dodir /usr/share/locale
+ make BASEDIR=${D} prefix=/usr mandir=/usr/share/man install || die
+
+ dobin mkpasswd
+ doman mkpasswd.1
+ dodoc README whois.conf debian/changelog debian/copyright
+
+ einfo ""
+ einfo "The example whois.conf is located in /usr/doc/${P}"
+ einfo ""
+}