Blame SOURCES/7.4.024

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