From nobody  Sun Apr 27 17:10:48 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id RAA07332;
          Sun, 27 Apr 1997 17:10:48 -0700 (PDT)
Message-Id: <199704280010.RAA07332@hub.freebsd.org>
Date: Sun, 27 Apr 1997 17:10:48 -0700 (PDT)
From: chiuk@indiana.edu
To: freebsd-gnats-submit@freebsd.org
Subject: mv of symbolic link can move directory instead of link
X-Send-Pr-Version: www-1.0

>Number:         3399
>Category:       bin
>Synopsis:       mv of symbolic link can move directory instead of link
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 27 17:20:01 PDT 1997
>Closed-Date:    Thu Jul 13 02:03:44 PDT 2000
>Last-Modified:  Thu Jul 13 02:07:08 PDT 2000
>Originator:     Kenneth Chiu
>Release:        2.2.1-RELEASE
>Organization:
Indiana University
>Environment:
FreeBSD bakery.bloomington.nsisw.com 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Tue Mar 25 15:12:02 GMT 1997     jkh@time.cdrom.com:/usr/src/sys/compile/GENERIC  i386

>Description:
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.
>How-To-Repeat:
% mkdir /tmp/dir
% touch /tmp/dir/foo
% ln -s /tmp/dir
% mkdir dest
% mv dir/ dest   # only occurs with trailing slash
% ls /tmp/dir
ls: /tmp/dir: No such file or directory

>Fix:

>Release-Note:
>Audit-Trail:

From: David Nugent <davidn@labs.usn.blaze.net.au>
To: chiuk@indiana.edu
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/3399: mv of symbolic link can move directory instead of link 
Date: Mon, 28 Apr 1997 11:23:01 +1000

 > 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.
 
 Regards,
 David
 David Nugent - Unique Computing Pty Ltd - Melbourne, Australia
 Voice +61-3-9791-9547  Data/BBS +61-3-9792-3507  3:632/348@fidonet
 davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/
 
 

From: Kenneth Chiu <chiuk@indiana.edu>
To: davidn@labs.usn.blaze.net.au (David Nugent)
Cc: chiuk@indiana.edu, freebsd-gnats-submit@freebsd.org
Subject: Re: bin/3399: mv of symbolic link can move directory instead of link
Date: Mon, 28 Apr 1997 10:57:14 -0500 (EST)

 > > 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.
 
 Hmm...I never realized this about ls.  Anyway, SunOS and Solaris
 both seem to just move the link, so there does appear to be some
 reason to expect either behavior.  How about we just follow whatever
 POSIX says for this one?
State-Changed-From-To: open->feedback 
State-Changed-By: nbm 
State-Changed-When: Wed Jun 28 03:25:48 PDT 2000 
State-Changed-Why:  
Was there anything about this in POSIX? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=3399 
State-Changed-From-To: feedback->closed 
State-Changed-By: nbm 
State-Changed-When: Thu Jul 13 02:03:44 PDT 2000 
State-Changed-Why:  
This is an intended feature, and there's been no feedback to counter 
this belief. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=3399 
>Unformatted:
