OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../glibc/glibc-2.5-hardened_tmp-1.patch
  5. # Copyright (C) 2007 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
  17. Date: 2006-10-11
  18. Initial Package Version: 2.5
  19. Upstream Status: Submitted - http://sources.redhat.com/bugzilla/show_bug.cgi?id=3348
  20. Origin: Openwall Owl Linux - glibc-2.3.2-owl-tmpfile.diff
  21. Description: This patch instructs mktemp(1) to use temporary file directory
  22. from the '-t' option. It also makes sure temporary files get removed after
  23. exiting the scripts.
  24. diff -Naur glibc-2.5.orig/debug/xtrace.sh glibc-2.5/debug/xtrace.sh
  25. --- glibc-2.5.orig/debug/xtrace.sh 2006-05-19 16:43:31.000000000 +0000
  26. +++ glibc-2.5/debug/xtrace.sh 2006-10-11 20:54:11.000000000 +0000
  27. @@ -161,32 +161,32 @@
  28. while read fct; do
  29. read file
  30. if test "$fct" != '??' -a "$file" != '??:0'; then
  31. - format_line $fct $file
  32. + format_line "$fct" "$file"
  33. fi
  34. done
  35. else
  36. - fifo=$(mktemp -u ${TMPDIR:-/tmp}/xtrace.XXXXXX)
  37. + fifo="`mktemp -ut xtrace.XXXXXXXXXX`" || exit
  38. + trap 'rm -f -- "$fifo"' EXIT
  39. + trap 'trap - EXIT; rm -f -- "$fifo"; exit 1' HUP INT QUIT TERM PIPE
  40. mkfifo -m 0600 $fifo || exit 1
  41. - trap 'rm $fifo; exit 1' SIGINT SIGTERM SIGPIPE
  42. # Now start the program and let it write to the FIFO.
  43. $TERMINAL_PROG -T "xtrace - $program $*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*; read < $fifo" &
  44. termpid=$!
  45. - $pcprofiledump -u $fifo |
  46. + $pcprofiledump -u "$fifo" |
  47. while read line; do
  48. - echo $line |
  49. + echo "$line" |
  50. sed 's/this = \([^,]*\).*/\1/' |
  51. - addr2line -fC -e $program
  52. + addr2line -fC -e "$program"
  53. done |
  54. while read fct; do
  55. read file
  56. if test "$fct" != '??' -a "$file" != '??:0'; then
  57. - format_line $fct $file
  58. + format_line "$fct" "$file"
  59. fi
  60. done
  61. read -p "Press return here to close $TERMINAL_PROG($program)."
  62. - echo > $fifo
  63. - rm $fifo
  64. + echo > "$fifo"
  65. fi
  66. exit 0
  67. diff -Naur glibc-2.5.orig/malloc/memusage.sh glibc-2.5/malloc/memusage.sh
  68. --- glibc-2.5.orig/malloc/memusage.sh 2006-05-19 16:47:26.000000000 +0000
  69. +++ glibc-2.5/malloc/memusage.sh 2006-10-11 21:02:37.000000000 +0000
  70. @@ -77,6 +77,15 @@
  71. exit 0
  72. }
  73. +# These variables are local
  74. +buffer=
  75. +data=
  76. +memusagestat_args=
  77. +notimer=
  78. +png=
  79. +progname=
  80. +tracemmap=
  81. +
  82. # Process arguments. But stop as soon as the program name is found.
  83. while test $# -gt 0; do
  84. case "$1" in
  85. @@ -213,7 +222,9 @@
  86. if test -n "$data"; then
  87. datafile="$data"
  88. elif test -n "$png"; then
  89. - datafile=$(mktemp ${TMPDIR:-/tmp}/memusage.XXXXXX 2> /dev/null)
  90. + datafile="`mktemp -t memusage.XXXXXXXXXX`" || exit
  91. + trap 'rm -f -- "$datafile"' EXIT
  92. + trap 'trap - EXIT; rm -f -- "$datafile"; exit 1' HUP INT QUIT TERM PIPE
  93. if test $? -ne 0; then
  94. # Lame, but if there is no `mktemp' program the user cannot expect more.
  95. if test "$RANDOM" != "$RANDOM"; then