Patchwork [3,of,3,V2] vfs: also audit rename

login
register
mail settings
Submitter Boris Feld
Date Dec. 31, 2018, 5:37 p.m.
Message ID <87831f03b758e133b8a9.1546277850@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/37415/
State Accepted
Headers show

Comments

Boris Feld - Dec. 31, 2018, 5:37 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1545828277 -3600
#      Wed Dec 26 13:44:37 2018 +0100
# Node ID 87831f03b758e133b8a94fa9e4f903b847c051fe
# Parent  6528ebfbd28f8fc3669257404eaa4b0aa2c2a2c8
# EXP-Topic vfs.audit-rename
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 87831f03b758
vfs: also audit rename

Renaming through the vfs is not used in many places, and none of them seems to
be a security risk.

However, it is still worthwhile to run the auditing on rename file to perform
developer-warning level checks.

Patch

diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -199,6 +199,7 @@  class abstractvfs(object):
         checkambig=True only in limited cases (see also issue5418 and
         issue5584 for detail).
         """
+        self._auditpath(dst, 'w')
         srcpath = self.join(src)
         dstpath = self.join(dst)
         oldstat = checkambig and util.filestat.frompath(dstpath)