diff options
author | Daniel Ahlberg <aliz@gentoo.org> | 2003-03-18 17:39:13 +0000 |
---|---|---|
committer | Daniel Ahlberg <aliz@gentoo.org> | 2003-03-18 17:39:13 +0000 |
commit | 454072637eb214f52bc09982ee2cdaf656ed339f (patch) | |
tree | 587805bd6e7586aa59214cb2991de1304a4610f8 /sys-apps | |
parent | small changes to the ebuild... (diff) | |
download | gentoo-2-454072637eb214f52bc09982ee2cdaf656ed339f.tar.gz gentoo-2-454072637eb214f52bc09982ee2cdaf656ed339f.tar.bz2 gentoo-2-454072637eb214f52bc09982ee2cdaf656ed339f.zip |
Security update
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/man/ChangeLog | 7 | ||||
-rw-r--r-- | sys-apps/man/files/digest-man-1.5l | 1 | ||||
-rw-r--r-- | sys-apps/man/files/man-1.5l-groff-1.18.patch | 24 | ||||
-rw-r--r-- | sys-apps/man/files/man-1.5l-locale-debug-info.patch | 57 | ||||
-rw-r--r-- | sys-apps/man/files/man-1.5l-redhat-patches.patch | 241 | ||||
-rw-r--r-- | sys-apps/man/files/man-1.5l-search-order.patch | 16 | ||||
-rw-r--r-- | sys-apps/man/files/man-1.5l-util_c-segfault.patch | 67 | ||||
-rw-r--r-- | sys-apps/man/files/man-1.5l-wrong-quotes.patch | 11 | ||||
-rw-r--r-- | sys-apps/man/man-1.5l.ebuild | 112 |
9 files changed, 535 insertions, 1 deletions
diff --git a/sys-apps/man/ChangeLog b/sys-apps/man/ChangeLog index 51d4656e46fd..9c75582483eb 100644 --- a/sys-apps/man/ChangeLog +++ b/sys-apps/man/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-apps/man # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.18 2003/03/13 18:39:24 doctomoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.19 2003/03/18 17:39:13 aliz Exp $ + +*man-1.5l (18 Mar 2003) + + 18 Mar 2003; Daniel Ahlberg <aliz@gentoo.org> : + Security update. 13 mar 2003; Olivier Reisch <doctomoe@gentoo.org> man-1.5k-r1.ebuild : Marked ppc stable diff --git a/sys-apps/man/files/digest-man-1.5l b/sys-apps/man/files/digest-man-1.5l new file mode 100644 index 000000000000..1d4a35da11da --- /dev/null +++ b/sys-apps/man/files/digest-man-1.5l @@ -0,0 +1 @@ +MD5 07fa5ab41c39afcd59cdef5139ef563b man-1.5l.tar.gz 218249 diff --git a/sys-apps/man/files/man-1.5l-groff-1.18.patch b/sys-apps/man/files/man-1.5l-groff-1.18.patch new file mode 100644 index 000000000000..26a65b8dd8c8 --- /dev/null +++ b/sys-apps/man/files/man-1.5l-groff-1.18.patch @@ -0,0 +1,24 @@ +--- man-1.5k/configure.orig 2002-12-26 06:23:53.000000000 +0200 ++++ man-1.5k/configure 2002-12-26 06:25:14.000000000 +0200 +@@ -473,9 +473,9 @@ + then + if test $Fnroff = "missing" + then +- nroff="nroff -Tlatin1 -mandoc" ++ nroff="nroff -Tlatin1 -c -mandoc" + else +- nroff="$Fnroff -Tlatin1 -mandoc" ++ nroff="$Fnroff -Tlatin1 -c -mandoc" + fi + troff="troff -mandoc" + echo "Warning: could not find groff" +@@ -484,7 +484,7 @@ + then + nroff="$Fgroff -Tlatin1 -mandoc" + else +- nroff="$Fnroff -Tlatin1 -mandoc" ++ nroff="$Fnroff -Tlatin1 -c -mandoc" + fi + troff="$Fgroff -Tps -mandoc" + jnroff="$Fgroff -Tnippon -mandocj" + diff --git a/sys-apps/man/files/man-1.5l-locale-debug-info.patch b/sys-apps/man/files/man-1.5l-locale-debug-info.patch new file mode 100644 index 000000000000..26df852b3d1e --- /dev/null +++ b/sys-apps/man/files/man-1.5l-locale-debug-info.patch @@ -0,0 +1,57 @@ + Do not print the 'man: No such file or directory' error if + 'man -d' was called and the NLS catalogue was not found, as + it confuses people, and be more informative. More info at: + + http://bugs.gentoo.org/show_bug.cgi?id= + + + Martin Schlemmer <azarah@gentoo.org> (26 Dec 2002). + +--- man-1.5k/catopen/catopen.c.orig 2002-12-26 08:25:07.000000000 +0200 ++++ man-1.5k/catopen/catopen.c 2002-12-26 10:25:06.000000000 +0200 +@@ -10,7 +10,11 @@ + extern char *my_malloc(int); /* in util.c */ + + #ifndef DEFAULT_NLSPATH +-#define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L" ++# if __GLIBC__ >= 2 ++# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N" ++# else ++# define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L" ++# endif + #endif + + static nl_catd my_catopenpath(char *name, char *path); +--- man-1.5k/src/gripes.c.orig 2002-12-26 08:13:53.000000000 +0200 ++++ man-1.5k/src/gripes.c 2002-12-26 10:29:46.000000000 +0200 +@@ -47,14 +47,25 @@ + if (!lg) + lg = getenv("LC_ALL"); + if ((s || lg) && (!lg || strncmp(lg, "en", 2))) { +- perror(mantexts); ++ /* This prints 'man: No such file or directory' which ++ * confuses people. The fprintf message should really ++ * be enouth ... ++ */ ++/* perror(mantexts); */ ++ + fprintf(stderr, +-"Failed to open the message catalog %s on the path NLSPATH=%s\n\n", +- mantexts, s ? s : "<none>"); ++"Failed to open the message catalog \"%s\" for locale \"%s\"\n\ ++(NLSPATH=\"%s\")\n\n", ++ mantexts, lg ? lg : "<none>", ++ s ? s : DEFAULT_NLSPATH); + } else if (debug) { +- perror(mantexts); ++ /* This prints 'man: No such file or directory' which ++ * confuses people. The fprintf message should really ++ * be enouth ... ++ */ ++/* perror(mantexts); */ + fprintf(stderr, +-"Looked whether there exists a message catalog %s, but there is none\n" ++"Looked whether there exists a message catalog \"%s\", but there is none\n\n" + "(and for English messages none is needed)\n\n", + mantexts); + } diff --git a/sys-apps/man/files/man-1.5l-redhat-patches.patch b/sys-apps/man/files/man-1.5l-redhat-patches.patch new file mode 100644 index 000000000000..1b0bb73ecb8a --- /dev/null +++ b/sys-apps/man/files/man-1.5l-redhat-patches.patch @@ -0,0 +1,241 @@ +diff -Narup man-1.5k.orig/gencat/genlib.c man-1.5k/gencat/genlib.c +--- man-1.5k.orig/gencat/genlib.c 1997-12-02 08:23:30.000000000 -0500 ++++ man-1.5k/gencat/genlib.c 2002-12-19 09:16:38.000000000 -0500 +@@ -47,6 +47,7 @@ up-to-date. Many thanks. + 01/14/91 4 nazgul Off by one on number specified entries + */ + ++#undef _GNU_SOURCE + #include <stdio.h> + #ifdef SYSV + #include <sys/types.h> +diff -Narup man-1.5k.orig/src/apropos.sh man-1.5k/src/apropos.sh +--- man-1.5k.orig/src/apropos.sh 2001-11-22 18:30:42.000000000 -0500 ++++ man-1.5k/src/apropos.sh 2002-12-19 09:16:09.000000000 -0500 +@@ -18,9 +18,9 @@ program=`basename $0` + + # When man pages in your favorite locale look to grep like binary files + # (and you use GNU grep) you may want to add the 'a' option to *grepopt1. +-aproposgrepopt1='i' ++aproposgrepopt1='ia' + aproposgrepopt2='' +-whatisgrepopt1='iw' ++whatisgrepopt1='iwa' + whatisgrepopt2='^' + grepopt1=$%apropos_or_whatis%grepopt1 + grepopt2=$%apropos_or_whatis%grepopt2 +@@ -69,7 +69,7 @@ nothing= + found=0 + while [ $found = 0 -a -n "$1" ] + do +- for d in $manpath /usr/lib ++ for d in /var/cache/man /usr/lib + do + if [ -f $d/whatis ] + then +@@ -103,7 +103,7 @@ do + done + nothing= + found=0 +- for d in $manpath /usr/lib ++ for d in /var/cache/man $manpath /usr/lib + do + if [ -f $d/whatis ] + then + +diff -Narup man-1.5k.orig/src/man-getopt.c man-1.5k/src/man-getopt.c +--- man-1.5k.orig/src/man-getopt.c 2002-07-17 15:32:32.000000000 -0400 ++++ man-1.5k/src/man-getopt.c 2002-12-19 09:25:36.000000000 -0500 +@@ -171,7 +171,7 @@ get_options_from_string(const char *s) { + char **argvec; + int optindsv; + +- if (!s) ++ if (!s || *s==0) + return; + + /* In order to avoid having a list of options in two places, +diff -Narup man-1.5k.orig/src/man.c man-1.5k/src/man.c +--- man-1.5k.orig/src/man.c 2002-07-17 17:33:20.000000000 -0400 ++++ man-1.5k/src/man.c 2002-12-19 09:19:05.000000000 -0500 +@@ -300,7 +300,7 @@ ultimate_source (const char *name0) { + + if (strlen(name0) >= sizeof(ultname)) + return name0; +- strcpy(ultname, name0); ++ strncpy(ultname, name0, BUFSIZE-32); + name = ultname; + + again: +@@ -332,7 +332,7 @@ again: + * .so files - we could glob for all possible extensions, + * for now: only try .gz + */ +- else if (fp == NULL && get_expander(".gz") && ++ if (fp == NULL && get_expander(".gz") && + strlen(name)+strlen(".gz") < BUFSIZE) { + strcat(name, ".gz"); + fp = fopen (name, "r"); +@@ -361,7 +361,7 @@ again: + beg++; + + end = beg; +- while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0') ++ while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0' && (end-buf)<BUFSIZE) + end++; /* note that buf is NUL-terminated */ + /* hence the RH patch is superfluous */ + +@@ -394,6 +394,9 @@ again: + strcat(name, "/"); + strcat(name, beg); + } ++ /* If this is too long, bad things have already happened. * ++ * we should quit IMMEDIATELY. */ ++ if(strlen(name)>sizeof(ultname)) _exit(1); + + goto again; + } +@@ -1197,6 +1200,20 @@ main (int argc, char **argv) { + #endif + + ++ char *s; ++#define CHECK(p, l) s=getenv(p); if(s && (strlen(s)>l)) { fprintf(stderr, "ERROR: Environment variable %s too long!\n", p); exit(1); } ++ ++ CHECK("LANG", 32); ++ CHECK("MANPAGER", 128); ++ CHECK("PAGER", 128); ++ CHECK("SYSTEM", 64); ++ CHECK("MANROFFSEQ", 128); ++ CHECK("MANSECT", 128); ++ CHECK("MANPL", 128); ++ CHECK("MAN_HP_DIREXT", 128); ++ CHECK("LANGUAGE", 128); ++ CHECK("LC_MESSAGES", 128); ++ + #ifndef __FreeBSD__ + /* Slaven Rezif: FreeBSD-2.2-SNAP does not recognize LC_MESSAGES. */ + setlocale(LC_CTYPE, ""); /* used anywhere? maybe only isdigit()? */ + +diff -Narup man-1.5k.orig/src/makewhatis.sh man-1.5k/src/makewhatis.sh +--- man-1.5k.orig/src/makewhatis.sh 2002-07-17 14:59:05.000000000 -0400 ++++ man-1.5k/src/makewhatis.sh 2002-12-19 09:24:14.000000000 -0500 +@@ -41,7 +41,7 @@ + # and should be first. + # It is a bug to add /var/cache/man to DEFCATPATH. + dm= +-for d in /usr/man /usr/share/man ++for d in /usr/share/man /usr/X11R6/man /usr/local/man /usr/man + do + if [ -d $d ]; then + if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi +@@ -49,13 +49,13 @@ + done + DEFMANPATH=$dm + dc= +-for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man ++for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat + do + if [ -d $d ]; then + if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi + fi + done +-DEFCATPATH=$dc ++DEFCATPATH=$dc;$DEFMANPATH + + # In case /usr is read-only, make /usr/man/whatis (etc) a symlink to + # something like /var/cache/man/whatis. +@@ -70,12 +70,12 @@ + # We try here to be careful (and avoid preconstructed symlinks) + # in case makewhatis is run as root, by creating a subdirectory of /tmp. + +-TMPFILEDIR=/tmp/whatis.tmp.dir.$$ +-rm -rf TMPFILEDIR +-if ! mkdir -m 0700 $TMPFILEDIR; then +- echo Could not create $TMPFILEDIR +- exit 1; ++TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX` ++if [ $? -ne 0 ]; then ++ echo "$0: Can't create temp file, exiting..." ++ exit 1 + fi ++chmod 0700 $TMPFILEDIR + TMPFILE=$TMPFILEDIR/w + + # make sure TMPFILEDIR is deleted if program is killed or terminates +@@ -109,8 +109,10 @@ + continue;; + -s) setsections=1 + continue;; +- -u) findarg="-ctime 0" +- update=1 ++ -u) if [ -e /var/cache/man/whatis ]; then ++ findarg="-newer /var/cache/man/whatis" ++ update=1 ++ fi + continue;; + -v) verbose=1 + continue;; +@@ -149,14 +151,7 @@ + # first truncate all the whatis files that will be created new, + # then only update - we might visit the same directory twice + if [ x$update = x ]; then +- for pages in man cat +- do +- eval path="\$$pages"path +- for mandir in $path +- do +- cp /dev/null $mandir/whatis +- done +- done ++ cp /dev/null /var/cache/man/whatis + fi + + for pages in man cat +@@ -165,14 +160,10 @@ + eval path="\$$pages"path + for mandir in $path + do +- if [ x$verbose != x ]; then +- echo "about to enter $mandir" > /dev/stderr +- fi +- if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then +- if [ x$verbose != x ]; then +- echo skipping $mandir - we did it already > /dev/stderr +- fi +- else ++ [ -d "$mandir" ] || continue ++ if [ x$verbose != x ]; then ++ echo "about to enter $mandir" > /dev/stderr ++ fi + here=`pwd` + cd $mandir + for i in $sections +@@ -391,23 +382,14 @@ + + cd $here + +- # kludge for Slackware's /usr/man/preformat +- if [ $mandir = /usr/man/preformat ] +- then +- mandir1=/usr/man +- else +- mandir1=$mandir +- fi +- +- if [ -f ${mandir1}/whatis ] ++ if [ -f /var/cache/man/whatis ] + then +- cat ${mandir1}/whatis >> $TMPFILE ++ cat /var/cache/man/whatis >> $TMPFILE + fi +- sed '/^$/d' < $TMPFILE | sort | uniq > ${mandir1}/whatis ++ sed '/^$/d' < $TMPFILE | sort | uniq > /var/cache/man/whatis + +- chmod 644 ${mandir1}/whatis ++ chmod 644 /var/cache/man/whatis + rm $TMPFILE +- fi + done + done + diff --git a/sys-apps/man/files/man-1.5l-search-order.patch b/sys-apps/man/files/man-1.5l-search-order.patch new file mode 100644 index 000000000000..49af2be2beae --- /dev/null +++ b/sys-apps/man/files/man-1.5l-search-order.patch @@ -0,0 +1,16 @@ +diff -Narup man-1.5k.orig/src/man.conf.in man-1.5k/src/man.conf.in +--- man-1.5k.orig/src/man.conf.in 2002-07-17 15:08:40.000000000 -0400 ++++ man-1.5k/src/man.conf.in 2002-12-19 09:04:28.000000000 -0500 +@@ -36,10 +36,10 @@ + # + # Every automatically generated MANPATH includes these fields + # +-MANPATH /usr/man + MANPATH /usr/share/man +-MANPATH /usr/local/man + MANPATH /usr/X11R6/man ++MANPATH /usr/local/man ++MANPATH /usr/man + # + # Uncomment if you want to include one of these by default + # diff --git a/sys-apps/man/files/man-1.5l-util_c-segfault.patch b/sys-apps/man/files/man-1.5l-util_c-segfault.patch new file mode 100644 index 000000000000..0fa6c8472aca --- /dev/null +++ b/sys-apps/man/files/man-1.5l-util_c-segfault.patch @@ -0,0 +1,67 @@ + When calling man for instance with: + + $ man -k "foo bar" + + will result in the following crash: + + $ man -k "foo bar" + sh: line 1: unsafe: command not found + Error executing formatting or display command. + System command unsafe exited with status 127. + Segmentation fault + + The reason for this is that my_xsprintf() in util.c passes + NOT_SAFE as the result if the string is not shell safe. + When do_appros() (or whatever) then calls 'free(command)', + free() tries to free a constant, and segfault. + + The attached solution are not eligant, but works without + breaking the API. Basically we redefine NOT_SAFE as a + message that we want to display, prepended with 'echo'. + When the command is then executed, our message are displayed, + and not the the line containing: + + sh: line 1: unsafe: command not found + + Further more, we do not return NOT_SAFE, but rather a string + that we malloc, and then fill with the contents of NOT_SAFE, + which will solve us trying to free a constant. + + More info can be found at: + + http://bugs.gentoo.org/show_bug.cgi?id=9761 + + Alternatively it is possible to redefine what is "shell safe", + but that will me a much more comprehensive fix ... + + + Martin Schlemmer <azarah@gentoo.org> (26 Dec 2002). + +--- man-1.5k/src/util.c.orig 2002-12-26 07:41:03.000000000 +0200 ++++ man-1.5k/src/util.c 2002-12-26 07:51:48.000000000 +0200 +@@ -237,7 +237,7 @@ + * The %S parameters are checked for being shell safe. + * The %Q parameters are checked for being shell safe inside single quotes. + */ +-#define NOT_SAFE "/unsafe/" ++#define NOT_SAFE "echo Cannot run command, as it is not shell safe!\necho Check that you do not quote search strings, etc." + + static int + is_shell_safe(const char *ss, int quoted) { +@@ -295,8 +295,14 @@ + case 'Q': + case 'S': /* check and turn into 's' */ + ss = va_arg(p, char *); +- if (!is_shell_safe(ss, (s[1] == 'Q'))) +- return NOT_SAFE; ++ if (!is_shell_safe(ss, (s[1] == 'Q'))) { ++ /* we cannot return NOT_SAFE, as it will cause ++ * free to segfault in trying to free a constant ++ */ ++ s = my_malloc(sizeof(NOT_SAFE) + 1); ++ s = strncpy(s, NOT_SAFE, sizeof(NOT_SAFE)); ++ return s; ++ } + len += strlen(ss); + s[1] = 's'; + break; diff --git a/sys-apps/man/files/man-1.5l-wrong-quotes.patch b/sys-apps/man/files/man-1.5l-wrong-quotes.patch new file mode 100644 index 000000000000..c14ba4325474 --- /dev/null +++ b/sys-apps/man/files/man-1.5l-wrong-quotes.patch @@ -0,0 +1,11 @@ +--- man-1.5k/src/Makefile.in.orig 2002-12-26 06:43:39.000000000 +0200 ++++ man-1.5k/src/Makefile.in 2002-12-26 06:48:18.000000000 +0200 +@@ -16,7 +16,7 @@ + + pager = @pager@ + +-GS = -DGREPSILENT=\'@grepsilent@\' ++GS = -DGREPSILENT=\"@grepsilent@\" + DEFS = @DEFS@ $(GS) + CWARN = -Wall -Wstrict-prototypes -Wmissing-prototypes + CWARNNP = -Wall diff --git a/sys-apps/man/man-1.5l.ebuild b/sys-apps/man/man-1.5l.ebuild new file mode 100644 index 000000000000..83d08527e2c1 --- /dev/null +++ b/sys-apps/man/man-1.5l.ebuild @@ -0,0 +1,112 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/man-1.5l.ebuild,v 1.1 2003/03/18 17:39:13 aliz Exp $ + +IUSE="" + +inherit eutils + +NV="${PV}" +S="${WORKDIR}/${PN}-${NV}" +DESCRIPTION="Standard commands to read man pages" +SRC_URI="http://www.kernel.org/pub/linux/utils/man/man-${NV}.tar.gz" +HOMEPAGE="http://freshmeat.net/projects/man/" + +DEPEND="virtual/glibc" + +RDEPEND="sys-apps/cronbase + >=sys-apps/groff-1.18" + +SLOT="0" +KEYWORDS="x86 ppc sparc alpha hppa arm mips" +LICENSE="GPL-2" + +src_unpack() { + unpack ${A} + + cd ${S} + cp configure configure.orig + sed -e 's:/usr/lib/locale:$(prefix)/usr/lib/locale:g' \ + -e 's!/usr/bin:/usr/ucb:!/usr/bin:!' \ + configure.orig > configure + + local x="" + for x in / src/ man2html/ msgs/ + do + cd ${S}/${x} + cp Makefile.in Makefile.in.orig + sed -e '/inst.sh/d' \ + -e '/^CC =/c\' \ + -e "CC = gcc" \ + -e '/^CFLAGS =/c\' \ + -e "CFLAGS = ${CFLAGS}" \ + Makefile.in.orig > Makefile.in + done + + cd ${S}/gencat + cp Makefile Makefile.orig + sed -e "s:cc -o:gcc -o:" Makefile.orig > Makefile + + cd ${S} + # Fix search order in man.conf so that system installed manpages + # will be found first ... + epatch ${FILESDIR}/${P}-search-order.patch + + # For groff-1.18 or later we need to call nroff with '-c' + epatch ${FILESDIR}/${P}-groff-1.18.patch + + # Fix wierd failing in rare cases + epatch ${FILESDIR}/${P}-wrong-quotes.patch + + # Fix a crash when calling man with: man -k "foo bar" (bug #9761). + # <azarah@gentoo.org> (26 Dec 2002). + epatch ${FILESDIR}/${P}-util_c-segfault.patch + + # Various fixes from Redhat + epatch ${FILESDIR}/${P}-redhat-patches.patch + + # Do not print the 'man: No such file or directory' error if + # 'man -d' was called and the NLS catalogue was not found, as + # it confuses people, and be more informative ... (bug #6360) + # <azarah@gentoo.org> (26 Dec 2002). + epatch ${FILESDIR}/${P}-locale-debug-info.patch +} + +src_compile() { + local myconf="" + use nls && myconf="+lang all" + + ./configure -confdir=/etc \ + +sgid +fhs \ + ${myconf} || die + + make || die +} + +src_install() { + dodir /usr/{bin,sbin} + cd ${S} + make PREFIX=${D} install || die + + if [ -n "`use nls`" ] + then + cd ${S}/msgs + ./inst.sh ?? ${D}/usr/share/locale/%L/%N + fi + + chmod 2555 ${D}/usr/bin/man + chown root.man ${D}/usr/bin/man + + # Needed for makewhatis + keepdir /var/cache/man + + insinto /etc + cd ${S} + doins src/man.conf + + dodoc COPYING LSM README* TODO + + exeinto /etc/cron.daily + doexe ${FILESDIR}/makewhatis.cron +} + |