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