[PATCH 3 of 3 V2] vfs: also audit rename

Boris Feld boris.feld at octobus.net
Mon Dec 31 12:37:30 EST 2018


# HG changeset patch
# User Boris Feld <boris.feld at 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.

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)


More information about the Mercurial-devel mailing list