From d1b0155d805ce51d8f155e648d1e9ad2edb95397 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 5 Jan 2012 11:45:50 +0100 Subject: mv: allow moving symlink onto same-inode dest with >= 2 hard links Normally, mv detects a few subtle cases in which proceeding with a same-file rename would, with very high probability, cause data loss. Here, we have found a corner case in which one of these same-inode tests makes mv refuse to perform a useful operation. Permit that corner case. * src/copy.c (same_file_ok): Detect/exempt this case. * tests/mv/symlink-onto-hardlink: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. Initially reported by: Matt McCutchen in http://bugs.gnu.org/6960. Raised again by Anders Kaseorg due to http://bugs.debian.org/654596. Improved-by: Paul Eggert. --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8b670fc40..a94aaa26f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -491,6 +491,7 @@ TESTS = \ mv/part-symlink \ mv/partition-perm \ mv/perm-1 \ + mv/symlink-onto-hardlink \ mv/to-symlink \ mv/trailing-slash \ mv/update \ -- cgit v1.2.3-54-g00ecf