comparison mercurial/vfs.py @ 41092:9e593db5f1a1

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.
author Boris Feld <boris.feld@octobus.net>
date Wed, 26 Dec 2018 13:44:37 +0100
parents d9b6b9ed96d8
children 6498f0e03526
comparison
equal deleted inserted replaced
41091:d9b6b9ed96d8 41092:9e593db5f1a1
197 To avoid file stat ambiguity forcibly, checkambig=True involves 197 To avoid file stat ambiguity forcibly, checkambig=True involves
198 copying ``src`` file, if it is owned by another. Therefore, use 198 copying ``src`` file, if it is owned by another. Therefore, use
199 checkambig=True only in limited cases (see also issue5418 and 199 checkambig=True only in limited cases (see also issue5418 and
200 issue5584 for detail). 200 issue5584 for detail).
201 """ 201 """
202 self._auditpath(dst, 'w')
202 srcpath = self.join(src) 203 srcpath = self.join(src)
203 dstpath = self.join(dst) 204 dstpath = self.join(dst)
204 oldstat = checkambig and util.filestat.frompath(dstpath) 205 oldstat = checkambig and util.filestat.frompath(dstpath)
205 if oldstat and oldstat.stat: 206 if oldstat and oldstat.stat:
206 ret = util.rename(srcpath, dstpath) 207 ret = util.rename(srcpath, dstpath)