diff options
author | Grant Goodyear <g2boojum@gentoo.org> | 2002-06-09 02:25:26 +0000 |
---|---|---|
committer | Grant Goodyear <g2boojum@gentoo.org> | 2002-06-09 02:25:26 +0000 |
commit | 1a33dd893c21c4dd68218c1bfc16d9750ed8f4bf (patch) | |
tree | c6863e53d093fb3a9ac1f97e287d959086921736 | |
parent | Masked galeon 1.2.5 for testing. (diff) | |
download | gentoo-2-1a33dd893c21c4dd68218c1bfc16d9750ed8f4bf.tar.gz gentoo-2-1a33dd893c21c4dd68218c1bfc16d9750ed8f4bf.tar.bz2 gentoo-2-1a33dd893c21c4dd68218c1bfc16d9750ed8f4bf.zip |
New package.
-rw-r--r-- | net-misc/hesiod/ChangeLog | 27 | ||||
-rw-r--r-- | net-misc/hesiod/files/digest-hesiod-3.0.2 | 1 | ||||
-rw-r--r-- | net-misc/hesiod/files/hesiod-3.0.2-env.patch | 27 | ||||
-rw-r--r-- | net-misc/hesiod/files/hesiod-3.0.2-shlib.patch | 50 | ||||
-rw-r--r-- | net-misc/hesiod/files/hesiod-3.0.2-str.patch | 68 | ||||
-rw-r--r-- | net-misc/hesiod/hesiod-3.0.2.ebuild | 59 |
6 files changed, 232 insertions, 0 deletions
diff --git a/net-misc/hesiod/ChangeLog b/net-misc/hesiod/ChangeLog new file mode 100644 index 000000000000..f7153828eaa7 --- /dev/null +++ b/net-misc/hesiod/ChangeLog @@ -0,0 +1,27 @@ +# ChangeLog for <CATEGORY>/<PACKAGE_NAME> +# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/hesiod/ChangeLog,v 1.1 2002/06/09 02:25:26 g2boojum Exp $ + +*hesiod-3.0.2 (8 Jun 2002) + + 8 Jun 2002; Grant Goodyear <g2boojum@gentoo.org> : + + Initial import into portage. RH requires this package for sendmail; + I figure better safe than sorry. + +-- Explanation of ChangeLog format: + + Every new version or revision of the package should be marked by a '*' + seperator line as above. Changes since the last revision have to be added to + the top of the file, underneath the initial copyright and cvs header + comments, in exactly the same format as this comment. + + This means that you start with header line that has the following format, + indented two spaces: + + DD MMM YYYY; your_name <your_email> changed_file1, changed_file2: Your + explanation should follow. It should be indented and wrapped at a line width + of 80 characters. The changed_files can be omitted if they are obvious; for + example, if you are only modifying the .ebuild file and committing a new rev + of a package. Any details about what exactly changed in the code should be + added as a message when the changes are committed to cvs, not in this file. diff --git a/net-misc/hesiod/files/digest-hesiod-3.0.2 b/net-misc/hesiod/files/digest-hesiod-3.0.2 new file mode 100644 index 000000000000..d6d44043a687 --- /dev/null +++ b/net-misc/hesiod/files/digest-hesiod-3.0.2 @@ -0,0 +1 @@ +MD5 0362311e80fb1e029a1588cbbd09ad57 hesiod-3.0.2.tar.gz 31974 diff --git a/net-misc/hesiod/files/hesiod-3.0.2-env.patch b/net-misc/hesiod/files/hesiod-3.0.2-env.patch new file mode 100644 index 000000000000..444cc3b539f0 --- /dev/null +++ b/net-misc/hesiod/files/hesiod-3.0.2-env.patch @@ -0,0 +1,27 @@ +Ignore environment variables in setuid or setgid programs. +--- hesiod-3.0.2/hesiod.c Wed Oct 3 14:53:37 2001 ++++ hesiod-3.0.2/hesiod.c Wed Oct 3 14:55:02 2001 +@@ -52,6 +52,7 @@ + #include <stdio.h> + #include <stdlib.h> + #include <string.h> ++#include <unistd.h> + #include <ctype.h> + #include "hesiod.h" + #include "hesiod_p.h" +@@ -79,13 +80,13 @@ + if (ctx) + { + *context = ctx; +- configname = getenv("HESIOD_CONFIG"); ++ configname = ((getuid() == geteuid()) && (getgid() == getegid())) ? getenv("HESIOD_CONFIG") : NULL; + if (!configname) + configname = SYSCONFDIR "/hesiod.conf"; + if (read_config_file(ctx, configname) >= 0) + { + /* The default rhs can be overridden by an environment variable. */ +- p = getenv("HES_DOMAIN"); ++ p = ((getuid() == geteuid()) && (getgid() == getegid())) ? getenv("HES_DOMAIN") : NULL; + if (p) + { + if (ctx->rhs) diff --git a/net-misc/hesiod/files/hesiod-3.0.2-shlib.patch b/net-misc/hesiod/files/hesiod-3.0.2-shlib.patch new file mode 100644 index 000000000000..128db5a24dbf --- /dev/null +++ b/net-misc/hesiod/files/hesiod-3.0.2-shlib.patch @@ -0,0 +1,50 @@ +--- hesiod-3.0.2/Makefile.in Fri Oct 5 15:43:35 2001 ++++ hesiod-3.0.2/Makefile.in Fri Oct 5 15:47:42 2001 +@@ -21,20 +21,24 @@ + CFLAGS=@CFLAGS@ + LDFLAGS=@LDFLAGS@ + LIBS=@LIBS@ +-ALL_CFLAGS=-I. -DSYSCONFDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} ++ALL_CFLAGS=-I. -DSYSCONFDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} -fPIC + OBJS=hesiod.o hesmailhost.o hespwnam.o hesservbyname.o hescompat.o ++SOVERSION=0 + +-all: libhesiod.a hesinfo hestest ++all: libhesiod.a hesinfo hestest libhesiod.so.$(SOVERSION) ++ ++libhesiod.so.$(SOVERSION): ${OBJS} ++ $(LD) -G -o $@ -soname=$@ ${OBJS} ${LIBS} -lc + + libhesiod.a: ${OBJS} + ar cru $@ ${OBJS} + ${RANLIB} $@ + +-hesinfo: hesinfo.o libhesiod.a +- ${CC} ${LDFLAGS} -o $@ hesinfo.o libhesiod.a ${LIBS} ++hesinfo: hesinfo.o libhesiod.so.$(SOVERSION) ++ ${CC} ${LDFLAGS} -o $@ hesinfo.o libhesiod.so.$(SOVERSION) ${LIBS} + +-hestest: hestest.o libhesiod.a +- ${CC} ${LDFLAGS} -o $@ hestest.o libhesiod.a ${LIBS} ++hestest: hestest.o libhesiod.so.$(SOVERSION) ++ ${CC} ${LDFLAGS} -o $@ hestest.o libhesiod.so.$(SOVERSION) ${LIBS} + + ${OBJS}: hesiod.h resscan.h + +@@ -42,6 +46,7 @@ + ${CC} -c ${ALL_CFLAGS} $< + + check: ++ LD_LIBRARY_PATH="`pwd`":"$(LD_LIBRARY_PATH)" \ + HESIOD_CONFIG=${srcdir}/hesiod.config.sample \ + ./hestest ${srcdir}/hestest.conf + +@@ -55,6 +60,8 @@ + ${INSTALL} -c -m 644 libhesiod.a ${DESTDIR}${libdir} + ${RANLIB} ${DESTDIR}${libdir}/libhesiod.a + chmod u-w ${DESTDIR}${libdir}/libhesiod.a ++ ${INSTALL} -c -m 755 libhesiod.so.$(SOVERSION) ${DESTDIR}${libdir} ++ ln -s libhesiod.so.$(SOVERSION) ${DESTDIR}${libdir}/libhesiod.so + ${INSTALL_PROGRAM} -c -m 555 hesinfo ${DESTDIR}${lbindir} + ${INSTALL} -c -m 444 ${srcdir}/hesiod.h ${DESTDIR}${includedir} + ${INSTALL} -c -m 444 ${srcdir}/hesinfo.1 ${DESTDIR}${mandir}/man1 diff --git a/net-misc/hesiod/files/hesiod-3.0.2-str.patch b/net-misc/hesiod/files/hesiod-3.0.2-str.patch new file mode 100644 index 000000000000..a763e539105d --- /dev/null +++ b/net-misc/hesiod/files/hesiod-3.0.2-str.patch @@ -0,0 +1,68 @@ +There are a few places where untrusted information could cause problems. +There's a bug in the configuration file parser that might result in an +LHS= modifying the rhs setting. +The case-insensitive comparison routine is probably called safely (with the +second argument at least as long as the first), but it looks weird. +--- hesiod-3.0.2/hesiod.c Wed Oct 3 15:16:17 2001 ++++ hesiod-3.0.2/hesiod.c Wed Oct 3 15:33:41 2001 +@@ -138,7 +138,8 @@ + const char *rhs; + int len; + +- strcpy(bindname, name); ++ strncpy(bindname, name, sizeof(bindname) - 1); ++ bindname[sizeof(bindname) - 1] = 0; + + /* Find the right right hand side to use, possibly truncating bindname. */ + p = strchr(bindname, '@'); +@@ -288,7 +289,7 @@ + + if (cistrcmp(key, "lhs") == 0 || cistrcmp(key, "rhs") == 0) + { +- which = (strcmp(key, "lhs") == 0) ? &ctx->lhs : &ctx->rhs; ++ which = (cistrcmp(key, "lhs") == 0) ? &ctx->lhs : &ctx->rhs; + *which = malloc(strlen(data) + 1); + if (!*which) + { +@@ -462,7 +463,7 @@ + + static int cistrcmp(const char *s1, const char *s2) + { +- while (*s1 && tolower(*s1) == tolower(*s2)) ++ while (*s1 && *s2 && tolower(*s1) == tolower(*s2)) + { + s1++; + s2++; +--- hesiod-3.0.2/hespwnam.c Wed Oct 3 15:29:40 2001 ++++ hesiod-3.0.2/hespwnam.c Wed Oct 3 15:29:43 2001 +@@ -39,9 +39,16 @@ + + struct passwd *hesiod_getpwuid(void *context, uid_t uid) + { +- char uidstr[16]; ++ char uidstr[32]; + +- sprintf(uidstr, "%d", uid); +- return getpwcommon(context, uidstr, 1); ++ if (snprintf(uidstr, sizeof(uidstr), "%ld", (long)uid) < sizeof(uidstr)) ++ { ++ return getpwcommon(context, uidstr, 1); ++ } ++ else ++ { ++ errno = ERANGE; ++ return NULL; ++ } + } + +--- hesiod-3.0.2/hesservbyname.c Wed Oct 3 15:33:25 2001 ++++ hesiod-3.0.2/hesservbyname.c Wed Oct 3 15:33:22 2001 +@@ -188,7 +188,7 @@ + + static int cistrcmp(const char *s1, const char *s2) + { +- while (*s1 && tolower(*s1) == tolower(*s2)) ++ while (*s1 && *s2 && tolower(*s1) == tolower(*s2)) + { + s1++; + s2++; diff --git a/net-misc/hesiod/hesiod-3.0.2.ebuild b/net-misc/hesiod/hesiod-3.0.2.ebuild new file mode 100644 index 000000000000..c8350c0c5274 --- /dev/null +++ b/net-misc/hesiod/hesiod-3.0.2.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/hesiod/hesiod-3.0.2.ebuild,v 1.1 2002/06/09 02:25:26 g2boojum Exp $ + +DESCRIPTION="Hesiod is a system which uses existing DNS functionality to provide access to databases of information that changes infrequently." + +HOMEPAGE="ftp://athena-dist.mit.edu/pub/ATHENA/hesiod" +LICENSE="ISC" +DEPEND="virtual/glibc" +#RDEPEND="" +SRC_URI="ftp://athena-dist.mit.edu/pub/ATHENA/${PN}/${P}.tar.gz" + +S=${WORKDIR}/${P} + +src_unpack() { + unpack ${A} + #Patches stolen from RH + cat ${FILESDIR}/hesiod-3.0.2-shlib.patch | patch -d ${S} -p1 + cat ${FILESDIR}/hesiod-3.0.2-env.patch | patch -d ${S} -p1 + cat ${FILESDIR}/hesiod-3.0.2-str.patch | patch -d ${S} -p1 + cd ${S} + for manpage in *.3 + do + if grep -q '^\.so man3/hesiod.3' ${manpage} + then + echo .so hesiod.3 > ${manpage} + elif grep -q '^\.so man3/hesiod_getmailhost.3' ${manpage} + then + echo .so hesiod_getmailhost.3 > ${manpage} + elif grep -q '^\.so man3/hesiod_getpwnam.3' ${manpage} + then + echo .so hesiod_getpwnam.3 > ${manpage} + elif grep -q '^\.so man3/hesiod_getservbyname.3' ${manpage} + then + echo .so hesiod_getservbyname.3 > ${manpage} + fi + done +} + +src_compile() { + ./configure \ + --host=${CHOST} \ + --prefix=/usr \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man || die "./configure failed" + emake || die + #make || die +} + +src_install () { + make DESTDIR=${D} install || die + #make \ + # prefix=${D}/usr \ + # mandir=${D}/usr/share/man \ + # infodir=${D}/usr/share/info \ + # install || die + # Again, verify the Makefiles! We don't want anything falling + # outside of ${D}. +} |