From owner-freebsd-bugs Mon Apr 28 05:28:32 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA11618 for bugs-outgoing; Mon, 28 Apr 1997 05:28:32 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA11607 for ; Mon, 28 Apr 1997 05:28:22 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id WAA17698; Mon, 28 Apr 1997 22:15:42 +1000 Date: Mon, 28 Apr 1997 22:15:42 +1000 From: Bruce Evans Message-Id: <199704281215.WAA17698@godzilla.zeta.org.au> To: davidn@labs.usn.blaze.net.au, freebsd-bugs@hub.freebsd.org Subject: Re: bin/3399: mv of symbolic link can move directory instead of link Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > If a symbolic link is entered with a trailing /, the directory it > > references instead of the link is moved. This could cause loss of > > data, if someone assumes that the original directory was not affected. > > Wrong assumption. :-) > > IMHO this a a feature, not a bug. Many programs assume you wish to > look "through" a symlink if you add the trailing slash. /bin/ls, for > example. mv's behaviour therefore would seem to be expected. It is a feature (the trailing slash says to follow the link), but many systems do it differently. FreeBSD itself does rmdir differently - rmdir("symlink/") fails although rename("symlink/", "newname") renames the direcory pointed to by "symlink" to "newname". Note that you have to use rename(2) instead of mv(1) to test this. mv may rewrite some of the names. Bruce