D785: context: also consider path conflicts when clearing unknown files
mbthomas (Mark Thomas)
phabricator at mercurial-scm.org
Tue Oct 17 15:16:04 UTC 2017
mbthomas added inline comments.
INLINE COMMENTS
> swhitaker wrote in context.py:1941
> This breaks test-audit-path.t on macOS. In the test "attack /tmp/test", we call this codepath with f == '/tmp/test'. util.finddirs finds '/tmp', which on macOS is a symlink to /private/tmp, so L1940 is true and on L1941 we try to unlink /tmp.
>
> @mbthomas Is it intentional that we try to unlink symlinks to directories here? If not, we can fix this with:
>
> - if wvfs.isfileorlink(p):
> + if wvfs.isfileorlink(p) and not wvfs.isdir(p):
It's intentional to unlink symlinks, but it should not be doing anything outside the vfs. This is missing a vfs.audit() call. I've created https://phab.mercurial-scm.org/D1157 to fix it.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D785
To: mbthomas, #hg-reviewers, ryanmce
Cc: swhitaker, ryanmce, kiilerix, mercurial-devel
More information about the Mercurial-devel
mailing list