Go Back   FlashFXP Forums > > > >

ioFTPD General New releases, comments, questions regarding the latest version of ioFTPD.

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-29-2003, 07:35 PM   #1
Phantazm
Junior Member
 
Join Date: Oct 2003
Posts: 4
Exclamation Does ioftpd really follow the RFC's?

I've noticed a lil variation with ioftpd comparing to every other ftpd i've tested. (well real old windows ftpd's doesnt count)

All ftpd's have a certan amount of fields/chars in the dirlist.
So if i use some kinda scripting it's pretty easy for me to determine files and folders.
So far i've tested the following ftpd's
  • glftpd
  • proftpd
  • pure-ftpd
  • vftpd
  • G6 (Bulletproof) ftpd
  • serv-u
  • raiden ftpd

Everyone of them works the same way

The code i use is the following test string (some more to it but this is the important part.)
it knows that after 55 chars the foldername begins.
It works on all mentioned ftpd's except for ioftpd.
That makes one wonder why ioftpd is breaking a standard or is it just pure luck that the others are simular

Quote:
Snippet of my perl code:

my @test = $ftp_a->dir;
my @dirs;
my @files;

foreach (@test) {
if (substr($_,0,1) eq "d") { push (@dirs,$_); }
else { push (@files,$_); }
}

my @dirnames;
foreach (@dirs) {
push (@dirnames,substr($_,55));
}

my @filnames;
foreach (@files) {
push (@filnames,substr($_,55));
}
YES there are probably ways to get around this with other coding but the thing is that if ioftpd doesnt follow a certain standard/rfc there might come up more problems later on.

Is this a thing thats goin to be changed in ioftpd or am i totally lost here and should shove my code somewhere hehe.

Would be really nice with some comments so that i know if i should go change my entire code or there will be a update on ioftpd

Thats about it

Peace!
Phantazm is offline   Reply With Quote
Old 10-29-2003, 08:14 PM   #2
dasOp
Member
 
Join Date: Jan 2003
Posts: 91
Default

Hate to ruin your fun, but the LIST-parsing code of a graphical ftp client is usually the hairiest part of it.

Reason? The ftp-protocol rfc's do not specify the format. At all.
So servers are free to do exactly what they want. Nonetheless, these things tend to implicitly standardize themselves anyways, and as things are now, they all resemble the output from unix 'ls'.
The key to parsing em is not to rely on specific character positions but to tokenize the fields as they usually are the same.
dasOp is offline   Reply With Quote
Old 10-29-2003, 09:19 PM   #3
darkone
Disabled
FlashFXP Registered User
ioFTPD Administrator
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

Yep.. iis format is completely different that's why there is 'SYST' command. You can expect that user & group names never contain spaces... btw, how does your program handle files larger than 1gb?
darkone is offline   Reply With Quote
Old 10-30-2003, 03:31 AM   #4
Phantazm
Junior Member
 
Join Date: Oct 2003
Posts: 4
Default

hehe ok. Well to bad that ioftpd is the only one thats differs from all the others.

Dark.. ppl that have files thats over 1 gb in size should be dragged out back and be executed But your probably right it would screw things up to.

Well thanx for the info anyhow

anyone got any suggestions on how i could parse the list to make it universal
Phantazm is offline   Reply With Quote
Old 10-30-2003, 03:38 AM   #5
darkone
Disabled
FlashFXP Registered User
ioFTPD Administrator
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

Use -1 parameter, if you do not want anything other than filenames.. (or NLST)
darkone is offline   Reply With Quote
Old 10-30-2003, 03:43 AM   #6
Phantazm
Junior Member
 
Join Date: Oct 2003
Posts: 4
Default

well nlist and the -1 also give me filenames.

But one could change the parse to read everything that is with *.??? should be a file and the rest dirs. but thats prolly not 100% bulletproof hehe


Just change code in ioftpd thats a quick surgery hehe
Phantazm is offline   Reply With Quote
Old 10-30-2003, 03:57 AM   #7
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

The LIST reply isnt really in the rfc standards.
Why dont you determine the 55 dynamically? It is quite easy to do and apparently you havent tested all that good also. Make very long user and/or groupnames on the ftpserver and you will see that the LIST output changes in some of the cases you tested.
So my advise: use some intelligent parsing.
dr--r--r-- 1 user group 0 Feb 11 15:50 dirname
FTPServerTools is offline   Reply With Quote
Old 10-30-2003, 04:35 AM   #8
Phantazm
Junior Member
 
Join Date: Oct 2003
Posts: 4
Default

changed the code tho this.
it should be quite as good

Quote:
foreach (@test) {
if ($_ =~ /\....$/i) { push (@files,$_); }
else { push (@dirs,$_); }
}
hopefully no filenames ends with .???

So now i'm pretty happy again
Phantazm is offline   Reply With Quote
Reply

Tags
code, ftpd, ftpds, ioftpd, push

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:38 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)