bug#36818: mv fails to clobber target if it's a hardlink of a source

2019-07-26 Thread Sergei Trofimovich
On Fri, 26 Jul 2019 13:01:44 -0500 Eric Blake wrote: > On 7/26/19 12:43 PM, Sergei Trofimovich wrote: > > > Is it an 'mv's bug or a feature to prevent hardlinked file clobbering? > > If feels like an unnecessary restriction. > > It's a POSIX (mis-)feature that for hard links, rename("file1",

bug#36818: mv fails to clobber target if it's a hardlink of a source

2019-07-26 Thread Eric Blake
On 7/26/19 12:43 PM, Sergei Trofimovich wrote: > Is it an 'mv's bug or a feature to prevent hardlinked file clobbering? > If feels like an unnecessary restriction. It's a POSIX (mis-)feature that for hard links, rename("file1", "file2") is a mandatory no-op (no error, but also no change to the ex

bug#36818: mv fails to clobber target if it's a hardlink of a source

2019-07-26 Thread Sergei Trofimovich
The below is a bug initially reported by Xuefer at https://bugs.gentoo.org/646412. Reproducer: $ mv --version mv (GNU coreutils) 8.31 Packaged by Gentoo (8.31 (p0)) $ touch a.aa $ ln a.aa b.bb $ mv a.aa b.bb mv: 'a.aa' and 'b.bb' are the same file For comparison if fines are unre