Opened 15 years ago
Last modified 15 years ago
#1387 closed Bug report
PWD Reply Parse: single-quoted paths are never parsed (bug)
|Reported by:||adrian_u||Owned by:|
|Keywords:||Cc:||adrian_u, Tim Kosse|
|Component version:||Operating system type:|
|Operating system version:|
There is a subtle bug in CControlSocket::ParsePwdReply():
int pos1 = reply.Find('"');
int pos2 = reply.Find('"', true);
if (pos1 == -1 pos1 >= pos2)
int pos1 = reply.Find('\);
int pos2 = reply.Find('\, true);
The variables â€œpos1â€ and â€œpos2â€ are overridden within the inner â€œifâ€ block so, after it completes its execution, the assigned values get lost and the original variables remain unchanged.
The fix is straightforward: simply remove the â€œintâ€ keyword in the assignment of â€œpos1â€ and â€œpos2â€ within the â€œifâ€ block.
Change History (5)
by , 15 years ago
comment:1 by , 15 years ago
I'm tired of adding workarounds for broken servers that totally disregard the FTP specifications. It just blows up code size and causes slowdowns for proper servers.
To quote RFC 959:
upon successful completion of an MKD
command, the server should return a line of the form:
Essentially because the PWD command returns the same type of
information as the successful MKD command, the successful PWD
command uses the 257 reply code as well.
Just upgrade to a better server to fix this problem.
comment:2 by , 15 years ago
Thatâ€™s true. Thank you for your response.
Unfortunately the server is an old and horrible mainframe (Bull.)
comment:3 by , 15 years ago
If it's old, even the cheapest modern computer should outperform it.
comment:4 by , 15 years ago
Youâ€™re right again.
Unfortunately, we have too many Cobol programs in production and the migration process will take some years.