After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 151594 - Directory listings parsed wrong on windows ftp server
Directory listings parsed wrong on windows ftp server
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Module: ftp
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 155748 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-09-01 11:29 UTC by Simon Howard
Modified: 2005-01-28 13:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix Windows NT servers (4.86 KB, patch)
2005-01-28 09:24 UTC, Simon Howard
none Details | Review
fixed patch to fix windows nt servers (4.88 KB, patch)
2005-01-28 13:19 UTC, Simon Howard
none Details | Review

Description Simon Howard 2004-09-01 11:29:54 UTC
The directory listings are not parsed correctly when connected to a Windows NT
ftp server. I end up with filenames like "1009 May 17  15:58  errors.txt".  

The version string returned by the server is:

ftp> quote syst
215 Windows_NT version 5.0

The problem seems to be that gnome-vfs is expecting the directory style to be in
an msdos 'dir' style output.  However, this server defaults at least to the more
"standard" Unix layout (Windows is trying to behave as something of a good
citizen for once, and vfs isnt expecting it :-P).

It is possible to toggle the output with the "site dirstyle" command:

ftp> site dirstyle
200 MSDOS-like directory output is on
ftp> site dirstyle
200 MSDOS-like directory output is off

"site dirstyle" only toggles msdos style on and off, you cannot say "turn on" or
"turn off"

Perhaps a sensible thing to do in the case of connecting to an NT server would
be to execute the "site dirstyle" command before doing any directory listings,
so that the directory style is known before doing parsing.  I doubt it matters
which style is used as it seems unlikely one style is going to give much more if
any more information over the other.

This is only for version 5.0; I dont know how earlier versions behave/behaved.
Comment 1 Simon Howard 2004-09-01 11:47:00 UTC
There is apparently a registry key in Windows to toggle the default, so it is
not possible to rely on the IIS FTP server being in either mode at startup:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q103/0/75.asp&NoWebContent=1

"site dirstyle" has apparently been supported since NT server 3.1 at least. 
KDE's kioslave just uses this command to toggle into Unix-style output.  Is the
DOS-style output parsing code in gnome-vfs redundant?
Comment 2 Simon Howard 2004-09-02 18:17:57 UTC
By the way, if you want to see this effect for yourself, pointing Nautilus at
ftp://ftp.microsoft.com/ seems to demonstrate it fairly effectively.
Comment 3 Simon Howard 2005-01-28 09:24:45 UTC
Created attachment 36639 [details] [review]
Patch to fix Windows NT servers

I have tested this on a couple of servers and viewed the traffic under
Ethereal.  It seems to work properly.
Comment 4 Christophe Fergeau 2005-01-28 09:30:04 UTC
> I have tested this on a couple of server

Only windows servers, or did you also test unix servers (I don't see how your
patch could affect unix servers, but a quick test doesn't hurt ;)
Did you get a chance to test it with old (eg winnt 4.0) servers?
Apart from that, this patch looks fine.
Comment 5 Simon Howard 2005-01-28 12:46:17 UTC
I figured you were right, and I should probably do some more comprehensive
testing. As usual, Google is a great thing.  By searching for login banners, I
managed to turn up servers running the following:

* NETWARE
* Microsoft FTP v3.0
* Microsoft FTP v4.0
* Microsoft FTP v5.0
* wu-2.6.2
* sftpd
* proftpd 1.2.9
* SunOS 5.8

In each of these cases the patched version runs fine.
Comment 6 Christophe Fergeau 2005-01-28 13:02:58 UTC
Great, thanks for the testing ;)
Can you replace the // comments with /* .. */ comments (otherwise it won't
compile on some platforms). Apart from that, the patch looks fine.
Comment 7 Simon Howard 2005-01-28 13:19:53 UTC
Created attachment 36645 [details] [review]
fixed patch to fix windows nt servers

Ok, here you go.
Comment 8 Christophe Fergeau 2005-01-28 13:37:52 UTC
*** Bug 155748 has been marked as a duplicate of this bug. ***
Comment 9 Sebastien Bacher 2005-01-28 13:45:48 UTC
commited to HEAD, thanks