You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by co...@apache.org on 1999/04/28 23:58:40 UTC

Re: mod_proxy/3778: Problems with ftp proxy.

[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]


Synopsis: Problems with ftp proxy.

Comment-Added-By: coar
Comment-Added-When: Wed Apr 28 14:58:38 PDT 1999
Comment-Added:
[comment made by John Auer <ja...@aeronix.com>]
RE: mod_proxy, PR number 3778

This should fix it.  Hopefully it doesn't break anything else.  The
problem is/was: due to the size of the uid/gid fields in the directory
ls, the ".." filename starts one character to the right of all the
other filenames.  Unfortunately, the code used the position of the
".." as the starting position for the remaining filenames (to support
filenames that start with a space).  I did some quick tests, and the
patch seems to correctly handle spaces in filenames.


*** apache_1.3.4.orig/src/modules/proxy/proxy_ftp.c     Fri Jan  1 14:05:03 1999
--- apache_1.3.4/src/modules/proxy/proxy_ftp.c  Wed Feb 24 19:12:36 1999
***************
*** 361,367 ****
                firstfile = 0;
                searchidx = filename - buf;
            }
!           else if (searchidx != 0 && buf[searchidx] != 0) {
                *(--filename) = ' ';
                buf[searchidx - 1] = 0;
                filename = &buf[searchidx];
--- 361,367 ----
                firstfile = 0;
                searchidx = filename - buf;
            }
!           else if (searchidx != 0 && buf[searchidx] != 0 && *(filename-2) == ' ') {
                *(--filename) = ' ';
                buf[searchidx - 1] = 0;
                filename = &buf[searchidx];