Wrong URI's from FTP with 8.2.2.5

Hi,

thanks a lot for implementing the correct Copy filenames as URL's - but with 8.2.2.5 only the local file scheme works and not the "FTP".

  1. The display here is wrong (see screenshot below):
  • "FTP" => "ftp" .. lower case should be used - as "http" or "file" - much nicier or isn't it? :wink:

  • After the domain ".com" two slashes will be displayed. That's not correct. It seams to me that the complete domain with the trailing slash and the absolute path with the leading slash have been added.

The Copy Filenames As Names only works as expected and returns httpd.conf

But the Copy filenames as Full Pathnames returns FTP://user:password@xyz.com//etc/httpd/conf/httpd.conf

  • It should only return /etc/httpd/conf/httpd.conf and not the full URI!

The Copy filenames as URL's returns FTP://xyz.com//etc/httpd/conf/httpd.conf

I'm also wondering that with Copy filenames as Full Pathnames the user and password will be added and with Copy filenames as URL's not.

However - for security reason I highly recommend NOT to do this because if you copy & paste the string and someone is behind you he would see your user+password.

I hope this could be fixed soon. :slight_smile:

Does this really matter? Seems like nit-picking to me, and I'm sure as many people will prefer capitals as will prefer lowercase, with even more not caring either way.

FTP URLs use the format:

://:@:/

From RFC 1738:

[quote]url-path:
The rest of the locator consists of data specific to the scheme, and is known as the "url-path". It supplies the details of how the specified resource can be accessed. Note that the "/" between the host (or port) and the url-path is NOT part of the url-path.[/quote]
If the path is /etc/httpd/conf/httpd.conf then the first slash is the separator and the second slash is the first character of the path.

This allows you to reference files/foldes by the default path that you login to. [u]FTP://moo.com/public_html[/u] and [u]FTP://moo.com//public_html[/u] will be two different directories, uness the server puts you in the root by default.

No - I don't ... but "file://" you write in lower-case, URI's in browsers are in lowercase - so please it would be nice to do the same as all others are doing. I never see it in uppercase anywhere. Don't you think it would be nicier to be more constantly?

Please check the updated RFC's of RFC 1738:
RFC 2396
RFC 2373
RFC 2732
RFC 3986

At the top of RFC 2396 you can read Updates: 1808, 1738.
At the top of RFC 3986 you can read Updates: 1738. Obsoletes: 2732, 2396, 1808

As I said - for SECURITY REASON DO NOT create user + password!

It happens very often that my boss or co-workes are behind me and say to me: Please send me the link by e-mail! and then they wait until I copy & paste the URI into the e-mail and press SEND. Believe me - I know from what I speak - from a daily work as computer programmer!

So - never create a URI with user+password!

Instead of
ftp://user:password@xyz.com/hello/abc.txt
ONLY CORRECTLY create
ftp://xyz.com/hello/abc.txt

When you login on a FTP you always have your own home directory and the absolute path starts from there. The real path on the FTP server is completely another point.

When I copy & paste the URI and give it away I NEED the RIGHT URI and WITHOUT user + password.

But you can do an option in the preferences that an URI like ftp://user@xyz.com/hello/abc.txt should be created. A good browser opens a login window and pre-fills the user/login name. See screen shot below with Opera 9.02

I hope this helps to be more standard compliant and reduces confusing things.

Thanks.


"file" is a word while "FTP" and "HTTP" are acronyms.

I quoted the first RFC I found on Google so maybe it's out of date but I can't be bothered searching through the other ones to check what they say about double-slashes and the case of scheme names. If there's relevant and differnet information in the later RFCs then please quote it.

I agree that the username and password probably shouldn't be in the clipboard text, although it can be useful and I think there should be an option to include it, off by default.

An option for the user display in the FTP defaults, etc. would be great. Maybe an extra option for the password, but I'm not sure if it's a good idea. But not ONE option for both please!

I'll try to post the RFC differences later how to create a correct URI. I also have written a 100 % working Perl class which splits correct URI's or parts into his parts, etc (latest RFC incl. IPv6!). I'll try to send the source to you and maybe you could convert it in your language if something like that doesn't exist.

I know that FTP & HTTP are acronyms and 'file' is a word (or 'File' at the beginning? :wink:) but in an URI they are scheme names ... and as I said - I don't know any software which creates uppercase scheme names by default - except DOpus.

Opera 9 & MSIE 7 (6?) convert it to lower case when you enter a upper case scheme name and when I browse in forums or around the world (Google :wink:) etc I always see the scheme name in lower case (http, ftp, file, rtsp, mms, etc) ... and I also think it looks much nicier because domain names are also widly written in lower case ...

Just found - about / or // ... @ http://httpd.apache.org/docs/2.0/mod/core.html#location

Note about / (slash)

The slash character has special meaning depending on where in a URL it appears. People may be used to its behavior in the filesystem where multiple adjacent slashes are frequently collapsed to a single slash (i.e., /home///foo is the same as /home/foo). In URL-space this is not necessarily true. The <LocationMatch> directive and the regex version of <Location> require you to explicitly specify multiple slashes if that is your intention.

For example, <LocationMatch> would match the request URL /abc but not the request URL //abc ...

And if you want to access /bar on ftp.foo.com then ftp://ftp.foo.com//bar makes sense, else you'd be accessing bar (relative to the default directory, which is often not the root for FTP logins).

No - for me it's wrong.
Try any other tool (total commander, speed commander, browsers ...) no - "//" ...

I tried a few tools and they worked fine with //.

IMO, from my interpretation of the RFC, they are doing the wrong thing if they go to the root path when only given a single / unless the default directory is the root path (which is the case for a lot of anonymous FTP sites but very few non-anonymous ones).

To clarify something what happens:

The syntax looks like mailto:webmaster@xyz.com, not mailto://
webmaster@xyz.com/; developers used to the more common http:
syntax often put extra slashes in these URLs and cause them to fail.

and

When I run a tool with YOUR DO8(0) generated FTP URI it would do the
following:

  1. Connect to ftp
  2. Change to the directory to "/pub/ruby" instead of "pub/ruby"

When I edit the FTP site list in DO8 I can find the entry "Initial path" -
which is empty in my case. But when I select the FTP site properties
the Initial path "/" will be displayed. Why not empty? "/" is not the
same as empty!

[quote="fuzi1968"]To clarify something what happens:

The syntax looks like mailto:webmaster@xyz.com, not mailto://
webmaster@xyz.com/; developers used to the more common http:
syntax often put extra slashes in these URLs and cause them to fail.
[/quote]
Where does the bad mailto URL get generated? This is the first time mailto has been mentioned.

[quote]When I run a tool with YOUR DO8(0) generated FTP URI it would do the
following:

  1. Connect to ftp
  2. Change to the directory to "/pub/ruby" instead of "pub/ruby"
    [/quote]
    So get that other tool fixed so that it understands the difference between relative and absolute paths in FTP URLs?

(BTW, Opus isn't mine. I don't work for GPSoft, I just post here. :slight_smile: )

[quote]When I edit the FTP site list in DO8 I can find the entry "Initial path" -
which is empty in my case. But when I select the FTP site properties
the Initial path "/" will be displayed. Why not empty? "/" is not the
same as empty![/quote]
That is because the Site Properties dialog shows the current path, which must have been / in that case. If you CD to another directory and open the dialog it will show that path instead. I assume this is to make it easy to update the FTP bookmark so that it uses the current path as the default next time you connect.

Nobody does understand it:

When I enter "nothing" for "Initial directory" in the ftp site properties than you can not replace it with "/" - so don't show this character when I VIEW the properties.

When I login with my user/login on the FTP I should get the default home directory when it's empty - so the created path should be e.g. "ftp://xyz.com/abc/def/"

When I enter "/" in the "Initial directory" the created path should be "ftp://xyz.com//abc/def/".

That is a great difference. When you try to split the path into its contents then ALL other programs have to do this:

E.g. the ftp server has this path "/abc/def/abc/def" and the default home is "/abc/def" (for an empty initial path).

  1. Connect to xyz.com
  2. Change the path to "abc/def"
    and now I am in "/abc/def/abc/def"

but DO8 returns an extra initial path "/" and after doing this:

  1. Connect to xyz.com
  2. Change the path to "/abc/def"
    and now I am in "/abc/def" (as long my user has the rights)

So DO8+9 should return the correct initial path - and in my case this one is empty and does not include a "/".

Is now all clear and this could be fixed in DO8 or 9? :wink:

If you enter nothing for the initial directory and then connect to the site you will be in the site's default directory. That must be '/' in the case of this site. When you then view the properties it shows the current path, '/'.

With the rest of what you've said, I'm not sure what you are entering where or expecting to see where. Could you post some screenshots showing this stuff? That'd make it easier to understand.

i.e. "I typed this path into this dialog box, or path control -- screenshot -- and when I connected I instead was taken to this other path -- screenshot -- which seems wrong."

There's no such thing as an empty path. You can't telnet to a unix server and do cd "" so why do you think ftp works like that? When you connect to an ftp site you end up in that site's default directory, which could be anything - and this is what the site properties shows you.

Hi,

however I try it again to explain the bad URI re-creation of DOpus 8(+9?).

I hope one of the developers understand it:

When I create a FTP account and leave the field "Initial directory" empty, select this FTP and select FTP/View properties then a "/" will be shown as initial path which is wrong. An empty initial directory is different from using a "/"!

Let's do an example:

I have the URL "ftp://xyz.com/" and want to create an FTP connection in DOpus 8.

The FTP default path on my server is "/ftp/pub".

The FTP details:

Host: "xyz.com"
User: "user1"
Pwd: "*"
Initial directory: (empty)

So after the login the user is in "/ftp/pub/user1" on my server.

Opening Connection xyz.com:21
220 xyz.com FTP server (Version wu-2.6.2(1) Thu Jun 23 13:09:59 IDT 2005) ready.
331 Password required for user1.
230 User user1 logged in.
215 UNIX Type: L8
500 'FEAT': command not understood.
350 Restarting at 100. Send STORE or RETRIEVE to initiate transfer.
350 Restarting at 0. Send STORE or RETRIEVE to initiate transfer.
200 Type set to I.
257 "/ftp/pub/user1" is current directory.
200 PORT command successful.
150 Opening BINARY mode data connection for /bin/ls.
136 bytes received in 0.27 seconds (4.904 Kbytes/sec)
226 Transfer complete.

and DOpus 8 displays:

"FTP://xyz.com//ftp/pub/user1/"

and also the "Copy filenames as URL" re-creates:

"FTP://xyz.com//ftp/pub/user1/x"

which is not the same as "ftp://xyz.com/"!

The path+file from the returned <257 "/ftp/pub/user1" is current directory> should not be re-created in URL's!

When I give the URL away and the FTP default root on the server changes - the FTP does not work anymore!

There is also the issue that I can not select "Edit / Copy filenames ..." if the directory is empty and I'm not able to select a file! A "Copy filenames ..." should be possible from the title of the window - however.

Now I'll show you that "/" and the empty initial directory is not the same!

I've created the subdirectories "x" on my server:
mkdir /x
mkdir /ftp/pub/user1/x

For the URL "ftp://xyz.com/x":

Change the FTP settings to the initial directory to "x" (without slash) and try to connect again:

Opening Connection xyz.com:21
220 xyz.com FTP server (Version wu-2.6.2(1) Thu Jun 23 13:09:59 IDT 2005) ready.
331 Password required for user1.
230 User user1 logged in.
215 UNIX Type: L8
500 'FEAT': command not understood.
350 Restarting at 100. Send STORE or RETRIEVE to initiate transfer.
350 Restarting at 0. Send STORE or RETRIEVE to initiate transfer.
200 Type set to I.
257 "/ftp/pub/user1" is current directory.
250 CWD command successful.
257 "/ftp/pub/user1/x" is current directory.
200 PORT command successful.
150 Opening BINARY mode data connection for /bin/ls.
91 bytes received in 0.27 seconds (2.952 Kbytes/sec)
226 Transfer complete.

btw: I'm missing the log what is sent to the server ("CWD x")

The "x" works and we are in "/ftp/pub/user1/x". OK & correct!

For the URL "ftp://xyz.com//x": (2 slashes!):

Now change the FTP settings and set the initial directory to "/x" (with slash) and try to connect:

Opening Connection xyz.com:21
220 xyz.com FTP server (Version wu-2.6.2(1) Thu Jun 23 13:09:59 IDT 2005) ready.
331 Password required for user1.
230 User user1 logged in.
215 UNIX Type: L8
500 'FEAT': command not understood.
350 Restarting at 100. Send STORE or RETRIEVE to initiate transfer.
350 Restarting at 0. Send STORE or RETRIEVE to initiate transfer.
200 Type set to I.
257 "/ftp/pub/user1" is current directory.
550 Permission denied on server. You are restricted to your account.
257 "/ftp/pub/user1" is current directory.
200 PORT command successful.
150 Opening BINARY mode data connection for /bin/ls.
136 bytes received in 0.27 seconds (4.904 Kbytes/sec)
226 Transfer complete.

Now you see that "CWD /x" happens (no logging but you get back 550 Permission denied.

Do you see the difference if I would enter a leading "/" or nothing into the initial directory?

When I create a FTP account without an initial directory - DOpus 8+9 should give it back and do not replace it with "/" or add a leading "/"!

Directory Opus makes a relative path into a wrong absolute path!

Is now all clear and everyone knows what should be fixed and adapted?

Robert

I'll try to explain it again:

When you then view the site properties it shows the current path not the initial path. At most it's a badly worded label but not a code bug, and the reason the label is like that is that if you save the properties it will update the bookmark to use the current path as the initial path in future.

[quote="nudel"]I'll try to explain it again:

When you then view the site properties it shows the current path not the initial path. At most it's a badly worded label but not a code bug, and the reason the label is like that is that if you save the properties it will update the bookmark to use the current path as the initial path in future.[/quote]

Ok I understand the site properties now - badly worded.

But the "Copy filenames as URI" is wrong (or shouldn't used in this way) - because it returns the path in the URL. When I give THIS URL away and change the default FTP path to another directory then the URL won't work anymore! And this should be fixed or a 2nd menu "Copy filenames as URI" should be added ...

I can't see anything wrong with Copy Names as URIs.

I connect to a site without specifying an initial directory. I end up in /home/leo, which is the default for my account. If I then copy the URI for the .addressbook file in that directory the result is:

FTP://ftp.blah.com//home/leo/.addressbook

Which is the full path to it and which will work for anyone who has access to that path/file, regardless of their default directories.

[quote="nudel"]I can't see anything wrong with Copy Names as URIs.

I connect to a site without specifying an initial directory. I end up in /home/leo, which is the default for my account. If I then copy the URI for the .addressbook file in that directory the result is:

FTP://ftp.blah.com//home/leo/.addressbook

Which is the full path to it and which will work for anyone who has access to that path/file, regardless of their default directories.[/quote]

And what when I give the FTP away but the default FTP path on the server changes?

e.g. I have a link on my website "ftp://blah.com/downloadithere" and the root ftp is /ftp/pub/downloadithere ...

then I set up my server but the root ftp is /ftp/downloadithere ...

in your case I have a ftp://blah.com//ftp/pub/downloadithere .. which is not valid anymore after I have changed the default root path on the server .. this would require a change of all ftp links anywhere.

The same with http ..

the http servers root is e.g. /www/html .... and a request like xyz.com/abc.html would taken the file from /www/html/abc.html ..

but in your "logic" DO8/9 would create a path xyz.com/www/html/abc.html ... which is not the same!

It doesn't make any different if it is http or ftp or file!