From nobody@hyperreal.com Thu Mar 27 16:00:59 1997 Received: by taz.hyperreal.com (8.8.4/V2.0) id QAA29503; Thu, 27 Mar 1997 16:00:59 -0800 (PST) Message-Id: <199703280000.QAA29503@taz.hyperreal.com> Date: Thu, 27 Mar 1997 16:00:59 -0800 (PST) From: Leos Bitto Reply-To: bitto@kolej.mff.cuni.cz To: apbugs@hyperreal.com Subject: Spaces in file and directory names fool ftp proxy in Apache X-Send-Pr-Version: 3.2 >Number: 279 >Category: mod_proxy >Synopsis: Spaces in file and directory names fool ftp proxy in Apache >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Thu Mar 27 16:10:00 1997 >Last-Modified: Thu Apr 10 22:47:01 PDT 1997 >Originator: bitto@kolej.mff.cuni.cz >Organization: >Release: 1.2b7 >Environment: Linux 2.0.27 (RedHat 4.1) GCC 2.7.2.1 But this is totally irrelevant to this bug. >Description: When there's a space (%20) in name of the file or directory on ftp server, Apache FTP proxy generates something as: ftp://localhost/pub/test

Directory ftp://localhost/pub/test


total 9
drwxr-sr-x   4 root     ftpadm       1024 Mar 27 23:42 .
drwxrwsr-x  18 root     ftpadm       1024 Mar 27 23:21 ..
drwxr-sr-x   2 root     ftpadm       1024 Mar 27 23:21 a b
drwxr-sr-x   2 root     ftpadm       1024 Mar 27 23:21 c d e
-rw-r--r--   1 root     ftpadm       4536 Mar 27 22:12 name with spaces

Apache/1.2b7t correct. which, as you can see, is incorrect. >How-To-Repeat: Create files and/or directories with spaces in names on any ftp archive and connect to this ftp archive using Apache 1.2b7 ftp proxy (I think that other versions have this bug too). >Fix: There should be more clever algorithm in proxy_ftp.c. Now there is filename=strrchr(buf, ' '), which is too simple. Maybe you could steal some ideas from Squid - it handles spaces in names correctly. :-) %0 >Audit-Trail: State-Changed-From-To: open-feedback State-Changed-By: chuck State-Changed-When: Sun Apr 6 19:49:03 PDT 1997 State-Changed-Why: Can you give an example of an FTP site that delivers spaces in directory or file names? Thanks. State-Changed-From-To: feedback-closed State-Changed-By: chuck State-Changed-When: Thu Apr 10 22:47:00 PDT 1997 State-Changed-Why: A patch to improve handling of spaces in file names is available at http://www.apache.org in the directory for patches for 1.2b8, called mod_proxy-spaces.patch >Unformatted: