home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.445 < prev    next >
Encoding:
Internet Message Format  |  2004-04-03  |  2.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.445
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.445
  11. Problem:    Copying vimtutor to /tmp/something is not secure, a symlink may
  12.         cause trouble.
  13. Solution:   Create a directory and create the file in it.  Use "umask" to
  14.         create the directory with mode 700.  (Stefan Nordhausen)
  15. Files:        src/vimtutor
  16.  
  17.  
  18. *** ../vim-6.2.444/src/vimtutor    Wed Mar 13 10:04:11 2002
  19. --- src/vimtutor    Sun Apr  4 16:20:16 2004
  20. ***************
  21. *** 10,22 ****
  22.   xx=$1
  23.   export xx
  24.   
  25. ! # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
  26.   tmp="${TMPDIR-/tmp}"
  27. ! TUTORCOPY=`mktemp $tmp/tutorXXXXXX || tempfile -p tutor || echo $tmp/tutor$$`
  28.   export TUTORCOPY
  29.   
  30.   # remove the copy of the tutor on exit
  31. ! trap "rm -f $TUTORCOPY" 0 1 2 3 9 11 13 15
  32.   
  33.   # Vim could be called "vim" or "vi".  Also check for "vim6", for people who
  34.   # have Vim 5.x installed as "vim" and Vim 6.0 as "vim6".
  35. --- 10,43 ----
  36.   xx=$1
  37.   export xx
  38.   
  39. ! # We need a temp file for the copy.  First try using a standard command.
  40.   tmp="${TMPDIR-/tmp}"
  41. ! TUTORCOPY=`mktemp $tmp/tutorXXXXXX || tempfile -p tutor || echo none`
  42. ! # If the standard commands failed then create a directory to put the copy in.
  43. ! # That is a secure way to make a temp file.
  44. ! if test "$TUTORCOPY" = none; then
  45. !     tmpdir=$tmp/vimtutor$$
  46. !     OLD_UMASK=`umask`
  47. !     umask 077
  48. !     getout=no
  49. !     mkdir $tmpdir || getout=yes
  50. !     umask $OLD_UMASK
  51. !     if test $getout = yes; then
  52. !         echo "Could not create directory for tutor copy, exiting."
  53. !         exit 1
  54. !     fi
  55. !     TUTORCOPY=$tmpdir/tutorcopy
  56. !     touch $TUTORCOPY
  57. !     TODELETE=$tmpdir
  58. ! else
  59. !     TODELETE=$TUTORCOPY
  60. ! fi
  61.   export TUTORCOPY
  62.   
  63.   # remove the copy of the tutor on exit
  64. ! trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
  65.   
  66.   # Vim could be called "vim" or "vi".  Also check for "vim6", for people who
  67.   # have Vim 5.x installed as "vim" and Vim 6.0 as "vim6".
  68. ***************
  69. *** 32,37 ****
  70. --- 53,59 ----
  71.       fi
  72.   fi
  73.   
  74. + # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
  75.   # The script tutor.vim tells Vim which file to copy
  76.   $VIM -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
  77.   
  78. *** ../vim-6.2.444/src/version.c    Sun Apr  4 15:39:18 2004
  79. --- src/version.c    Sun Apr  4 16:18:21 2004
  80. ***************
  81. *** 639,640 ****
  82. --- 639,642 ----
  83.   {   /* Add new patch number below this line */
  84. + /**/
  85. +     445,
  86.   /**/
  87.  
  88. -- 
  89. hundred-and-one symptoms of being an internet addict:
  90. 266. You hear most of your jokes via e-mail instead of in person.
  91.  
  92.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  93. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  94. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  95.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  96.