From: SourceForge.net <no...@so...> - 2007-05-22 20:17:43
|
Bugs item #1720144, was opened at 2007-05-16 09:22 Message generated for change (Comment added) made by andreas_kupries You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112883&aid=1720144&group_id=12883 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ftpd Group: None Status: Open Resolution: None Priority: 8 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Andreas Kupries (andreas_kupries) Summary: Unable to ftp files with multiple spaces together Initial Comment: In ftp::read there is a line: set parts [split $command] The problem with splitting on a space is that multiple spaces will turn into empty list elements {}. I understand the split is needed to make sure $command is a valid list, but perhaps there could be some sort of statement to remove empty list elements. Something like: set parts [string map {\{\} ""} [split $command]] ---------------------------------------------------------------------- >Comment By: Andreas Kupries (andreas_kupries) Date: 2007-05-22 13:17 Message: Logged In: YES user_id=75003 Originator: NO File Added: ftpd.diff ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2007-05-22 13:05 Message: Logged In: YES user_id=75003 Originator: NO Re-reading the RFC 959 I think that the whole command/argument processing in the server is wrong. We are treating the line as Tcl list (set parts [...]) but the RFC says that after the command comes one separating space char, and everything after to the end of the line is one argument field, spaces and all. Which means that the code separating command and argument has to be redone ... Hm ... Possible solution is 'regexp' to find and split on first space. regexp {^([^ ]+) (.*)$} $command -> cmd argument and the lindex/lrange commands in lines 538 and 553 can be removed, replaced by the variables set by the regexp. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-05-16 11:46 Message: Logged In: NO Yeah, I forgot to mention that I rewrote the STOR command in my ftp server. The ftpd::read command will get a line like: "STOR this is my file name.txt" If you split that line, it looks exactly the same. Then it calls ftpd::command::STOR and currently: set filename [lindex $list 0] which would have a file on the server called "this" However, my STOR command says: set filename $list I think it's important that this package allow spaces in the names, since most windows users like to have spaces. That's just my two cents. ---------------------------------------------------------------------- Comment By: Larry W. Virden (lvirden) Date: 2007-05-16 09:26 Message: Logged In: YES user_id=15949 Originator: NO won't there also be a problem if the file to be ftp'd has spaces in the name? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112883&aid=1720144&group_id=12883 |