Log Message: |
Fix issue #4383, "Subversion 1.8.0 crash when WC path is symlink (regression)".
In 1.7, if a working copy root was found through a symlink, WCROOT->abspath
was set to the symlink itself, rather than the target of the symlink.
In 1.8.0, WCROOT->abspath is set to the symlink target instead.
It turns out that at least one caller relies on the 1.7 behaviour.
It computes relative paths within the working copy like this:
local_relpath = svn_dirent_skip_ancestor(wcroot->abspath, local_abspath);
and blindly uses the returned value as a path. If local_abspath is not a
child of wcroot->abspath, the skip_ancestor() function returns NULL.
So 1.8.0 ended up crashing with a NULL deref when updating working copies
through symlinks.
* subversion/libsvn_wc/wc_db_wcroot.c
(svn_wc__db_wcroot_parse_local_abspath): Restore 1.7 behaviour from the
caller's point of view. When a working copy root is found through a
symlink, ensure that WCROOT->ABSPATH is set to the symlink itself,
rather than its target.
* subversion/tests/cmdline/wc_tests.py
(update_through_unversioned_symlink): New test. Without the above fix,
this test fails with a crash when exclusive WC locking is disabled, and
fails with an SQLITE_BUSY error when exclusive WC locking is enabled.
Reported by: Lev Serebryakov <lev@FreeBSD.org>
|