]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.024 v7.4.024
authorBram Moolenaar <Bram@vim.org>
Sun, 8 Sep 2013 13:40:49 +0000 (15:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 Sep 2013 13:40:49 +0000 (15:40 +0200)
Problem:    When root edits a file the undo file is owned by root while the
            edited file may be owned by another user, which is not allowed.
            (cac2s)
Solution:   Accept an undo file owned by the current user.

src/undo.c
src/version.c

index 3acfad1ffa0c8433ae4265873b5de192eb879879..eb99294aa93158d9f00a250fc307180c57b372a9 100644 (file)
@@ -1604,10 +1604,11 @@ u_read_undo(name, hash, orig_name)
 
 #ifdef UNIX
        /* For safety we only read an undo file if the owner is equal to the
-        * owner of the text file. */
+        * owner of the text file or equal to the current user. */
        if (mch_stat((char *)orig_name, &st_orig) >= 0
                && mch_stat((char *)file_name, &st_undo) >= 0
-               && st_orig.st_uid != st_undo.st_uid)
+               && st_orig.st_uid != st_undo.st_uid
+               && st_undo.st_uid != getuid())
        {
            if (p_verbose > 0)
            {
index 0ad2f936635b3094769c4f7dfe4567257e35a157..9731f70c79a6b5219daa56e88e6d352c0ab44d7b 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    24,
 /**/
     23,
 /**/