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/files
parentbump (diff)
downloadgentoo-2-535c0ba457cc00e95a9c6b33a7a7587627f56ac3.tar.gz
gentoo-2-535c0ba457cc00e95a9c6b33a7a7587627f56ac3.tar.bz2
gentoo-2-535c0ba457cc00e95a9c6b33a7a7587627f56ac3.zip
bump
Diffstat (limited to 'sys-apps/man/files')
-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
11 files changed, 453 insertions, 0 deletions
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