Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | Signed-off-by: Scott Garman <scott.a.garman@intel.com> |
| 4 | |
| 5 | diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh |
| 6 | --- man-1.6e.orig/src/makewhatis.sh 2006-07-19 01:58:08.000000000 -0300 |
| 7 | +++ man-1.6e/src/makewhatis.sh 2007-05-18 10:18:31.000000000 -0300 |
| 8 | @@ -45,7 +45,7 @@ |
| 9 | # and should be first. |
| 10 | # It is a bug to add /var/cache/man to DEFCATPATH. |
| 11 | dm= |
| 12 | -for d in /usr/man /usr/share/man /usr/X11R6/man /usr/local/man |
| 13 | +for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man |
| 14 | do |
| 15 | if [ -d $d ]; then |
| 16 | if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi |
| 17 | @@ -53,7 +53,7 @@ |
| 18 | done |
| 19 | DEFMANPATH=$dm |
| 20 | dc= |
| 21 | -for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man |
| 22 | +for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man |
| 23 | do |
| 24 | if [ -d $d ]; then |
| 25 | if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi |
| 26 | @@ -76,12 +76,12 @@ |
| 27 | # We try here to be careful (and avoid preconstructed symlinks) |
| 28 | # in case makewhatis is run as root, by creating a subdirectory of /tmp. |
| 29 | |
| 30 | -TMPFILEDIR=/tmp/whatis.tmp.dir.$$ |
| 31 | -rm -rf $TMPFILEDIR |
| 32 | -if ! mkdir -m 0700 $TMPFILEDIR; then |
| 33 | - echo Could not create $TMPFILEDIR |
| 34 | - exit 1; |
| 35 | +TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX` |
| 36 | +if [ $? -ne 0 ]; then |
| 37 | + echo "$0: Can't create temp file, exiting..." |
| 38 | + exit 1 |
| 39 | fi |
| 40 | +chmod 0700 $TMPFILEDIR |
| 41 | TMPFILE=$TMPFILEDIR/w |
| 42 | |
| 43 | # make sure TMPFILEDIR is deleted if program is killed or terminates |
| 44 | diff -Naur man-1.6e.orig/src/man.c man-1.6e/src/man.c |
| 45 | --- man-1.6e.orig/src/man.c 2006-05-01 17:34:22.000000000 -0300 |
| 46 | +++ man-1.6e/src/man.c 2007-05-18 10:11:33.000000000 -0300 |
| 47 | @@ -1234,7 +1234,6 @@ |
| 48 | #endif |
| 49 | |
| 50 | |
| 51 | -#if 0 |
| 52 | { |
| 53 | /* There are no known cases of buffer overflow caused by |
| 54 | excessively long environment variables. In case you find one, |
| 55 | @@ -1257,7 +1256,6 @@ |
| 56 | MAN_ICONV_PATH, MAN_ICONV_OPT, MAN_ICONV_INPUT_CHARSET, |
| 57 | MAN_ICONV_OUTPUT_CHARSET, NLSPATH, PATH */ |
| 58 | } |
| 59 | -#endif |
| 60 | |
| 61 | |
| 62 | #ifndef __FreeBSD__ |