From owner-freebsd-bugs Sun Feb 11 21:20: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B0E0A37B4EC for ; Sun, 11 Feb 2001 21:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f1C5K1d05869; Sun, 11 Feb 2001 21:20:01 -0800 (PST) (envelope-from gnats) Date: Sun, 11 Feb 2001 21:20:01 -0800 (PST) Message-Id: <200102120520.f1C5K1d05869@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: bin/25013: mv(1) cannot move unresolvable symlinks across devices Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/25013; it has been noted by GNATS. From: Bruce Evans To: mkamm@gmx.net Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/25013: mv(1) cannot move unresolvable symlinks across devices Date: Mon, 12 Feb 2001 16:18:49 +1100 (EST) On Sun, 11 Feb 2001 mkamm@gmx.net wrote: > Unresolvable symlinks cannot be moved across devices with mv(1). > ... > >Fix: > > The problem was introduced with a code snippet that protects against > moving mountpoints. Moving mountpoints is bad, because that would > trigger "cp -pRP /mountpoint newname". My patch invokes this code > snippet only if a directory is to be moved and bypasses it otherwise. > (My patch also tries to avoid redundant lstat(2) calls.) I think the "protection" should just be removed. POSIX.2 doesn't mention a special case for mountpoints (at least least in my old draft copy that doesn't specify mountpoints :-). Moving a huge directory may be a mistake whether or not the directory is a mountpoint. It is practically impossible to "protect" against moving mountpoints deep in the hierarchy. I think that POSIX.2 and/or BSD made a mistake here, and mv should never move across filesystems without being forced to. gnu mv still refuses to move across filesystems in the last version that I have handy (a Feb 26 1997 Redhat version running under FreeBSD; this also has emulation problems -- "mv /tmp/q /usr" attempted to move the directory to /compat/linux/usr/q). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message