summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTavis Ormandy <taviso@gentoo.org>2003-09-06 12:17:11 +0000
committerTavis Ormandy <taviso@gentoo.org>2003-09-06 12:17:11 +0000
commit535c0ba457cc00e95a9c6b33a7a7587627f56ac3 (patch)
tree5c89e9249f396be3c12bcb82de18a53084ebc152 /sys-apps/man
parentbump (diff)
downloadgentoo-2-535c0ba457cc00e95a9c6b33a7a7587627f56ac3.tar.gz
gentoo-2-535c0ba457cc00e95a9c6b33a7a7587627f56ac3.tar.bz2
gentoo-2-535c0ba457cc00e95a9c6b33a7a7587627f56ac3.zip
bump
Diffstat (limited to 'sys-apps/man')
-rw-r--r--sys-apps/man/ChangeLog10
-rw-r--r--sys-apps/man/Manifest7
-rw-r--r--sys-apps/man/files/digest-man-1.5m1
-rw-r--r--sys-apps/man/files/man-1.5m-LL-linelength.patch10
-rw-r--r--sys-apps/man/files/man-1.5m-groff-1.18.patch24
-rw-r--r--sys-apps/man/files/man-1.5m-locale-debug-info.patch57
-rw-r--r--sys-apps/man/files/man-1.5m-makewhatis.cron11
-rw-r--r--sys-apps/man/files/man-1.5m-redhat-patches.patch223
-rw-r--r--sys-apps/man/files/man-1.5m-search-order.patch16
-rw-r--r--sys-apps/man/files/man-1.5m-security.patch22
-rw-r--r--sys-apps/man/files/man-1.5m-util_c-segfault.patch67
-rw-r--r--sys-apps/man/files/man-1.5m-wrong-quotes-v2.patch11
-rw-r--r--sys-apps/man/files/man-1.5m-wrong-quotes.patch11
-rw-r--r--sys-apps/man/man-1.5m.ebuild105
14 files changed, 571 insertions, 4 deletions
diff --git a/sys-apps/man/ChangeLog b/sys-apps/man/ChangeLog
index fb5be192bcc4..8d4099a444ad 100644
--- a/sys-apps/man/ChangeLog
+++ b/sys-apps/man/ChangeLog
@@ -1,6 +1,14 @@
# 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.35 2003/07/06 15:53:31 gmsoft Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.36 2003/09/06 12:17:06 taviso Exp $
+
+*man-1.5m (06 Sep 2003)
+
+ 06 Sep 2003; Tavis Ormandy <taviso@gentoo.org> man-1.5m.ebuild:
+ a new release, which closes #23436
+ makewhatis.cron will usually traverse manpages twice, which
+ is unnescessary, changing to traverse MANPATH. #23848
+ bump.
24 Jun 2003; Aron Griffis <agriffis@gentoo.org> man-1.5l-r6.ebuild:
Mark stable on alpha
diff --git a/sys-apps/man/Manifest b/sys-apps/man/Manifest
index c17154c9ae2d..005dff4130f4 100644
--- a/sys-apps/man/Manifest
+++ b/sys-apps/man/Manifest
@@ -1,11 +1,11 @@
MD5 d020fa3baaf93822ab983d529f28e7e1 man-1.5l-r3.ebuild 2311
-MD5 b16d3c1884d1643222b08ef5650868cc man-1.5m.ebuild 2565
+MD5 f81d7194bd7a5cd7d401526d28c3fc29 man-1.5m.ebuild 2583
MD5 f8b1c002982c8ad007dad7d16145dc78 man-1.5k-r1.ebuild 2563
MD5 ee72fd94fb8f63b92b9cb14d356b991d man-1.5l-r5.ebuild 2409
MD5 e7dc30c047d82ceee603b52863eebb05 man-1.5l-r4.ebuild 2357
MD5 a825386d37ad27ccddca70297edd6bfa man-1.5i-r3.ebuild 1723
MD5 ec0aa69a15cfed6240ef9c7666af616c man-1.5l-r6.ebuild 2594
-MD5 cc48ccc28bd49d8e81c0dac9d4156485 ChangeLog 5802
+MD5 498f9c454a9c9f1029f556f55b863707 ChangeLog 6058
MD5 cbbd4de51a8359a1ae81f46f2dad6bd8 files/man-1.5k-search-order.patch 489
MD5 7de4684156992ffd479e773a4abc79d7 files/man-1.5l-locale-debug-info.patch 2128
MD5 cbbd4de51a8359a1ae81f46f2dad6bd8 files/man-1.5l-search-order.patch 489
@@ -22,12 +22,13 @@ MD5 08bb9cc46b14ee967cab2354dc1e56a8 files/man-1.5l-redhat-patches.patch 7166
MD5 d8990b0dc5c9670156737c7012de3e9e files/man-1.5l-wrong-quotes.patch 411
MD5 fe9f5db8b8b6feaaac25563cb294c901 files/man-1.5m-util_c-segfault.patch 2276
MD5 df6ae39cf3544b31e1d9e11b74b43d13 files/man-1.5k-groff-1.18.patch 634
+MD5 eec39d59daf326df6282eb7c88212353 files/man-1.5m-makewhatis.cron 179
MD5 cb6f4195874e0c7bd39bc6ccc26611b7 files/man-1.5m-security.patch 781
MD5 34fd8ac346c17188a9eb54e64276feee files/makewhatis.cron 155
MD5 d8990b0dc5c9670156737c7012de3e9e files/man-1.5m-wrong-quotes.patch 411
MD5 9feb57fe5fbc4c123a42c7cf0314e628 files/digest-man-1.5m 61
MD5 cb6f4195874e0c7bd39bc6ccc26611b7 files/man-1.5l-security.patch 781
-MD5 08bb9cc46b14ee967cab2354dc1e56a8 files/man-1.5m-redhat-patches.patch 7166
+MD5 2a6b1a91ea6e3e46866a2a2f02ca9c70 files/man-1.5m-redhat-patches.patch 6782
MD5 963a9363ab4bdb32e5fccaf0edc48d19 files/man-1.5l-LL-linelength.patch 475
MD5 c40cc9207adc44cb98bf59a1e9e90766 files/digest-man-1.5i-r3 61
MD5 00f30e0e111b386b879a36f64180026c files/digest-man-1.5k-r1 60
diff --git a/sys-apps/man/files/digest-man-1.5m b/sys-apps/man/files/digest-man-1.5m
new file mode 100644
index 000000000000..40276c035044
--- /dev/null
+++ b/sys-apps/man/files/digest-man-1.5m
@@ -0,0 +1 @@
+MD5 d27867e59d3bbb971b00058f20ef8ea4 man-1.5m2.tar.gz 228145
diff --git a/sys-apps/man/files/man-1.5m-LL-linelength.patch b/sys-apps/man/files/man-1.5m-LL-linelength.patch
new file mode 100644
index 000000000000..10fcd0603a71
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-LL-linelength.patch
@@ -0,0 +1,10 @@
+--- man-1.5l/src/man.c.orig 2003-06-10 16:40:16.000000000 +0100
++++ man-1.5l/src/man.c 2003-06-10 16:40:57.000000000 +0100
+@@ -550,6 +550,7 @@
+ /* however, a .lt command here fails, only
+ .ev 1; .lt ...; .ev helps for my version of groff */
+ sprintf(eos(bufh), "echo \".ll %d.%di\"; ", ll/10, ll%10);
++ sprintf(eos(bufh), "echo \".nr LL %d.%di\"; ", ll/10, ll%10);
+ #if 0
+ sprintf(eos(bufh), "echo \".lt %d.%di\"; ", ll/10, ll%10);
+ #endif
diff --git a/sys-apps/man/files/man-1.5m-groff-1.18.patch b/sys-apps/man/files/man-1.5m-groff-1.18.patch
new file mode 100644
index 000000000000..26a65b8dd8c8
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-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.5m-locale-debug-info.patch b/sys-apps/man/files/man-1.5m-locale-debug-info.patch
new file mode 100644
index 000000000000..26df852b3d1e
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-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.5m-makewhatis.cron b/sys-apps/man/files/man-1.5m-makewhatis.cron
new file mode 100644
index 000000000000..fd454e7a3df8
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-makewhatis.cron
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# Uncomment the following if you want
+# your whatis database rebuilt regularly
+#
+# this is part of the man package
+#
+#
+
+#source /etc/profile
+#/usr/sbin/makewhatis -w
diff --git a/sys-apps/man/files/man-1.5m-redhat-patches.patch b/sys-apps/man/files/man-1.5m-redhat-patches.patch
new file mode 100644
index 000000000000..2e759e0ff3c8
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-redhat-patches.patch
@@ -0,0 +1,223 @@
+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
+
+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
+
+--- 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
diff --git a/sys-apps/man/files/man-1.5m-search-order.patch b/sys-apps/man/files/man-1.5m-search-order.patch
new file mode 100644
index 000000000000..49af2be2beae
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-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.5m-security.patch b/sys-apps/man/files/man-1.5m-security.patch
new file mode 100644
index 000000000000..2f7e9e3db64b
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-security.patch
@@ -0,0 +1,22 @@
+diff -urP man-1.5l/src/gripes.c man-1.5l/src/gripes.c
+--- man-1.5l/src/gripes.c Wed Jul 17 20:17:23 2002
++++ man-1.5l/src/gripes.c Fri Jun 6 14:51:21 2003
+@@ -28,0 +28,1 @@
++#include <string.h>
+@@ -68,0 +68,2 @@
++ unsigned int i = 0;
++ unsigned short fmt_n = 0;
+@@ -78,0 +78,13 @@
++ /* routine to filter format string abuse. will */
++ /* only allow %d, %s, and %o through. no more */
++ /* than two formats needed for any response. */
++ for (i = 0; s[i] != 0x0; i++){
++ if (s[i] == '%' && s[i+1]){
++ if (strchr("dso", s[i+1])) /* %d,%s,%o. */
++ fmt_n++;
++ else
++ fmt_n=3; /* anything else = <limit. */
++ }
++ if (fmt_n > 2) /* failed, default reply. */
++ s = msg[n];
++ }
diff --git a/sys-apps/man/files/man-1.5m-util_c-segfault.patch b/sys-apps/man/files/man-1.5m-util_c-segfault.patch
new file mode 100644
index 000000000000..0fa6c8472aca
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-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.5m-wrong-quotes-v2.patch b/sys-apps/man/files/man-1.5m-wrong-quotes-v2.patch
new file mode 100644
index 000000000000..aa514c2ceca3
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-wrong-quotes-v2.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=0x71
+ DEFS = @DEFS@ $(GS)
+ CWARN = -Wall -Wstrict-prototypes -Wmissing-prototypes
+ CWARNNP = -Wall
diff --git a/sys-apps/man/files/man-1.5m-wrong-quotes.patch b/sys-apps/man/files/man-1.5m-wrong-quotes.patch
new file mode 100644
index 000000000000..2ec1c66a68b8
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-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=$(shell echo "@grepsilent@" | hexdump -d -n 1 | gawk '{ printf("0x%x", $$2); exit 0 }')
+ DEFS = @DEFS@ $(GS)
+ CWARN = -Wall -Wstrict-prototypes -Wmissing-prototypes
+ CWARNNP = -Wall
diff --git a/sys-apps/man/man-1.5m.ebuild b/sys-apps/man/man-1.5m.ebuild
new file mode 100644
index 000000000000..1e4f81581dcc
--- /dev/null
+++ b/sys-apps/man/man-1.5m.ebuild
@@ -0,0 +1,105 @@
+# 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.5m.ebuild,v 1.1 2003/09/06 12:17:06 taviso Exp $
+
+IUSE="nls"
+
+inherit eutils
+
+NV="1.5m2"
+S="${WORKDIR}/${PN}-${NV}"
+DESCRIPTION="Standard commands to read man pages"
+SRC_URI="mirror://kernel/linux/utils/man/man-${NV}.tar.gz"
+HOMEPAGE="http://freshmeat.net/projects/man/"
+
+DEPEND="virtual/glibc
+ >=sys-apps/sed-4"
+
+RDEPEND="sys-apps/cronbase
+ >=sys-apps/groff-1.18"
+
+SLOT="0"
+KEYWORDS="~x86 ~alpha"
+LICENSE="GPL-2"
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S} && \
+ sed -i \
+ -e 's:/usr/lib/locale:$(prefix)/usr/lib/locale:g' \
+ -e 's!/usr/bin:/usr/ucb:!/usr/bin:!' \
+ configure || die "configure sed failed"
+
+ sed -i -e 's:cc -o:$(CC) -o:' gencat/Makefile \
+ || die "gencat/Makefile sed failed"
+
+ # security fix
+ epatch ${FILESDIR}/${P}-security.patch
+
+ # 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-v2.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
+
+ # Line length overidden by nroff macros, thanks to
+ # <grant.mcdorman@sympatico.ca> for the patch, (bug #21018).
+ # -taviso@gentoo.org
+ epatch ${FILESDIR}/${P}-LL-linelength.patch
+}
+
+src_compile() {
+ local myconf=
+
+ use nls && myconf="+lang all"
+
+ ./configure -confdir=/etc \
+ +sgid +fhs \
+ ${myconf} || die "configure failed"
+
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ dodir /usr/{bin,sbin}
+ cd ${S}
+ make PREFIX=${D} install || die "make install failed"
+
+ insinto /etc
+ doins src/man.conf
+
+ dodoc COPYING LSM README* TODO
+
+ if [ -n "`use nls`" ]
+ then
+ cd ${S}/msgs
+ ./inst.sh ?? ${D}/usr/share/locale/%L/%N
+ fi
+
+ chown root.man ${D}/usr/bin/man
+ chmod 2555 ${D}/usr/bin/man
+
+ # Needed for makewhatis
+ keepdir /var/cache/man
+
+ exeinto /etc/cron.daily
+ newexe ${FILESDIR}/${P}-makewhatis.cron makewhatis.cron
+}