Discussion:
idftpserver checksum change
(too old to reply)
API
2008-06-21 18:03:18 UTC
Permalink
procedure
TIdFTPServer.CommandCheckSum(ASender:
TIdCommand);
..
if Pos('"', LBuf) > 0 then {do
not localize}
begin
Fetch(LBuf, '"'); {do not localize}
LFileName := Fetch(LBuf, '"');
{do not localize}
end else begin
//LFileName := Fetch(LBuf);
LFileName := LBuf; // 21062008!
end;
..

Above change will help with lot of ftp
clients that wants to checksum but
doesn't do " marks..

kind regards
Remy Lebeau (TeamB)
2008-06-21 22:35:05 UTC
Permalink
Above change will help with lot of ftp clients that wants
to checksum but doesn't do " marks..
Such clients would be in violation of then RFCs then. The quotes are
required for filenames that have embedded spaces into them. Besides, your
change would break the XCRC/XMD5/XSHA commands anyway, as they all have
additional Begin/EndPos parameters that can follow the filename. If the
Fetch() is removed as you suggest, then those parameter would be stored in
LFileName, which is wrong.


Gambit
API
2008-06-21 23:36:59 UTC
Permalink
Post by Remy Lebeau (TeamB)
additional Begin/EndPos parameters that can follow the filename. If the
Fetch() is removed as you suggest, then those parameter would be stored in
LFileName, which is wrong.
Sure it's wrong, but removing fetch will
not break the start and end positions
because they don't exist there in case
of bad clients. Bad clients in most
cases doesn't have " marks even, so all
it has is filename with or without
spaces and this definetely will work for
both good and bad clients now.
Remy Lebeau (TeamB)
2008-06-23 04:51:34 UTC
Permalink
Sure it's wrong, but removing fetch will not break
the start and end positions because they don't exist
there in case of bad clients.
Consider good clients that do not use quotes because there are no embedded
spaces. That would be valid syntax, and thus removing the Fetch() would
break those clients that do include the begin/end positions. So again, I
cannot agree with removing the Fetch(). The only possible way that could
work for all situations would be if the code is updated to look for 1-2
trailing numbers at the end of the line. If present, the filename would be
all of the text between the leading commmd and the trailing numbers. Quotes
could then be removed from that remaining text if present.
Bad clients in most cases doesn't have " marks even
But good clients may not, either.
so all it has is filename with or without spaces and this
definetely will work for both good and bad clients now.
No, it would not work in all situations.


Gambit

Loading...