Subject: Re: Ls following links

From: [email-masked] (Andy Church)
Date: Fri, 26 Jun 1998 14:44:26 EDT

>A while back I've asked if there is a patch for wu-ftpd in order to simulate
>the way ls works as far as links are concerned.
>On a normal distribution ls will follow a link and if after that you do a
>'cd ...' instead of going back to where you came from, you go back one
>directory according to the normal directory structure.

     I'm not sure exactly what you're looking for.  wu-ftpd doesn't store
the current directory; it relies on the system for that.  So you see
exactly the same thing you'd get if you did ls, cd, etc. from a shell
prompt.  If you don't see that, it may be because your FTP client is
outsmarting you and using its own idea of the path, and when you say
"cd ..", the client strips the last component off of its idea of the
current directory and sends an FTP CWD command for that new absolute
directory (I seem to recall that ncftp does this, at least in 1.9.5).
On the other hand, if you _want_ that sort of behavior from wu-ftpd, then
no, it doesn't do that right now, it would (at least on first thought) take
quite a bit of work to implement correctly, and I don't know of anyone
having done it.

  --Andy Church                  | If Bell Atlantic really is the heart
    [email-masked]       | of communication, then it desperately
    www.dragonfire.net/~achurch/ | needs a quadruple bypass.

---

From: Dan Stromberg <[email-masked]>
Date: Fri, 26 Jun 1998 12:01:29 -0700

> quite a bit of work to implement correctly, and I don't know of anyone

bingy-strombrg> pwd
/tmp/test
bingy-strombrg> ls -lR
total 16
drwxr-xr-x   3 strombrg 60            103 Jun 26 11:57 a
lrwxrwxrwx   1 strombrg 60              3 Jun 26 11:57 c -> a/b

a:
total 8
drwxr-xr-x   2 strombrg 60             69 Jun 26 11:57 b

a/b:
total 0
bingy-strombrg> cd c
bingy-strombrg> pwd
/tmp/test/c
bingy-strombrg> cd ..
bingy-strombrg> pwd
/tmp/test
bingy-strombrg> 

In other words, it's not uncommon for a shell to memorize where you came
from, and go back there on "cd ..", after you've cd'd to a symlinked
path.

This was with bash 2.01.1.

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 26 Jun 1998 15:47:29 -0400 (EDT)

> from, and go back there on "cd ..", after you've cd'd to a symlinked

There is quite a bit on this in the mailing list archives, along with some
pointers to patches to do what Dan wants.

Besides being a FRF, something like this will probably be needed for the
next generation daemon.  Take a look at the VFS specs coming out of the
FTP-WG.

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195