8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.024
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4.024
8b9a1c
Problem:    When root edits a file the undo file is owned by root while the
8b9a1c
	    edited file may be owned by another user, which is not allowed.
8b9a1c
	    (cac2s)
8b9a1c
Solution:   Accept an undo file owned by the current user.
8b9a1c
Files:	    src/undo.c
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.023/src/undo.c	2013-06-10 20:13:37.000000000 +0200
8b9a1c
--- src/undo.c	2013-09-07 15:45:56.000000000 +0200
8b9a1c
***************
8b9a1c
*** 1604,1613 ****
8b9a1c
  
8b9a1c
  #ifdef UNIX
8b9a1c
  	/* For safety we only read an undo file if the owner is equal to the
8b9a1c
! 	 * owner of the text file. */
8b9a1c
  	if (mch_stat((char *)orig_name, &st_orig) >= 0
8b9a1c
  		&& mch_stat((char *)file_name, &st_undo) >= 0
8b9a1c
! 		&& st_orig.st_uid != st_undo.st_uid)
8b9a1c
  	{
8b9a1c
  	    if (p_verbose > 0)
8b9a1c
  	    {
8b9a1c
--- 1604,1614 ----
8b9a1c
  
8b9a1c
  #ifdef UNIX
8b9a1c
  	/* For safety we only read an undo file if the owner is equal to the
8b9a1c
! 	 * owner of the text file or equal to the current user. */
8b9a1c
  	if (mch_stat((char *)orig_name, &st_orig) >= 0
8b9a1c
  		&& mch_stat((char *)file_name, &st_undo) >= 0
8b9a1c
! 		&& st_orig.st_uid != st_undo.st_uid
8b9a1c
! 		&& st_undo.st_uid != getuid())
8b9a1c
  	{
8b9a1c
  	    if (p_verbose > 0)
8b9a1c
  	    {
8b9a1c
*** ../vim-7.4.023/src/version.c	2013-09-07 16:35:38.000000000 +0200
8b9a1c
--- src/version.c	2013-09-08 15:38:52.000000000 +0200
8b9a1c
***************
8b9a1c
*** 740,741 ****
8b9a1c
--- 740,743 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     24,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
hundred-and-one symptoms of being an internet addict:
8b9a1c
186. You overstay in the office so you can have more time surfing the net.
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///