FTP problem to Name Based Virtual Server Web Site
Dave Cragg
dcragg at lacscentre.co.uk
Fri Jun 4 15:03:28 EDT 2004
At 7:09 pm -1000 3/6/04, Sannyasin Sivakatirswami wrote:
>Ok here we go with logs:
>
>ftp://jiva%40hheonline.org:password@55.55.55.555//home/jiva/mainwebsite_html/
>
>returns:
>
>200 Type set to A.
>CWD /home/jiva/mainwebsite_html
>250 CWD command successful.
>PORT 192,168,1,230,223,229
>200 PORT command successful
>LIST
>150 Opening ASCII mode data connection for file list
>226 Transfer complete.
>-rw-r--r-- 1 jiva jiva 4222 May 29 04:19 5advantages.shtml
>drwxrwxr-x 2 jiva jiva 4096 May 28 04:03 css
>-rw-r--r-- 1 jiva jiva 1438 May 29 04:19 favicon.ico
>drwxr-xr-x 2 jiva jiva 4096 May 29 04:24 financial_statements
>-rw-r--r-- 1 jiva jiva 2930 May 29 04:19 founders_message.shtml
>drwxr-xr-x 2 jiva jiva 4096 May 29 04:19 funds
>-rw-r--r-- 1 jiva jiva 42902 Jun 4 02:48 guestbook.html
>
>etc. i.e. a successful listing of what, from root on this site is actually:
>
>var/www/html/
What happens when you you get the same url but with a single slash
instead of a double slash? I'm guessing you will get the same result.
Similarly, what happens in Rev when you get the same url, but with a
single slash? Again, I'm guessing you will get the same.
>== back to interarchy:
>
>ftp://jiva%40hheonline.org:password@555.55.55.55//
>
>results:
>
>220 ProFTPD FTP Server ready.
>USER jiva at hheonline.org
>331 Password required for jiva at hheonline.org.
>PASS *****
>230 User jiva at hheonline.org logged in.
>PWD
>257 "/home/jiva" is current directory.
>TYPE A
>200 Type set to A.
>CWD /
>250 CWD command successful.
>PORT 192,168,1,230,223,235
>200 PORT command successful
>LIST
>150 Opening ASCII mode data connection for file list
>drwxr-xr-x 2 root root 4096 May 28 02:49 bin
>drwxr-xr-x 3 root root 4096 May 28 05:15 dev
>drwxr-xr-x 17 root jiva 4096 May 28 05:15 etc
>drwxr-x--x 3 jiva jiva 4096 May 28 02:49 home
>drwxr-xr-x 3 root root 4096 May 28 02:49 lib
>drwxr-xr-x 2 root root 4096 May 28 02:49 root
>drwxr-xr-x 2 root root 4096 May 28 02:49 sbin
>drwxrwxrwt 2 jiva jiva 4096 May 28 02:49 tmp
>drwxr-xr-x 13 root root 4096 May 28 02:49 usr
>drwxr-xr-x 11 root root 4096 May 28 02:49 var
>226 Transfer complete.
Again, do you get something different from Interarchy when you use a
single slash?
Here is a quick summary of how libUrl constructs the paths it uses in
calls to an ftp server.
When it logs on to the server, libUrl sends a PWD command to get the
current working directory (similar to most ftp clients). Depending on
the server, this may return a full path (.e.g. on my OS X ftp server
this is /Users/dave) or "/". (In the latter case, I think this
usually indicates that chroot is being used by the server.)
If the current working directory matches the first part of the path
in the url, then libUrl calls the path as written in the url. So if I
call my OS X server with
ftp://dave:pass@192.168.123.7/Users/dave/Documents/, libUrl will
return a listing of /Users/dave/Documents.
If the current working directory doesn't match the path in the url,
then libUrl prepends the current working diectory to the path in the
url. So, for example, if I call
ftp://dave:pass@192.168.123.7/Documents libUrl will also get a
listing of /Users/dave/Documents.
I may be wrong, but I think this is how it should be.
If you want to climb back up the file hierarchy, you can use "../".
For example, ftp://dave:pass@192.168.123.7/../ will return a listing
of the /Users directory.
With ftp://dave:pass@192.168.123.7/../../, I get a listing of the root volume.
I think you should be able to get what you need in this way.
Cheers
Dave
More information about the use-livecode
mailing list