Skip to content

Commit f54552b

Browse files
committed
updated for version 7.4.024
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.
1 parent bd42891 commit f54552b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/undo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,10 +1604,11 @@ u_read_undo(name, hash, orig_name)
16041604

16051605
#ifdef UNIX
16061606
/* For safety we only read an undo file if the owner is equal to the
1607-
* owner of the text file. */
1607+
* owner of the text file or equal to the current user. */
16081608
if (mch_stat((char *)orig_name, &st_orig) >= 0
16091609
&& mch_stat((char *)file_name, &st_undo) >= 0
1610-
&& st_orig.st_uid != st_undo.st_uid)
1610+
&& st_orig.st_uid != st_undo.st_uid
1611+
&& st_undo.st_uid != getuid())
16111612
{
16121613
if (p_verbose > 0)
16131614
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
24,
741743
/**/
742744
23,
743745
/**/

0 commit comments

Comments
 (0)