William,

Dagone spam filtering, this patch never made it to the
list.  Well I'll send it again, from a different e-mail..

So, here's the patch that fixes it for Netscape/Mozilla,
and whatever other browsers work similarly.

John Wojtowicz 

Senior Secure Systems Engineer

Trusted Computer Solutions
2350 Corporate Park Drive
Suite 500
Herndon, VA  20171

P: 703-318-7134
F: 703-318-5041
--- proxy_ftp.c 2004-05-28 15:15:15.960934000 -0400
+++ proxy_ftp.c.new     2004-05-28 15:14:27.480934000 -0400
@@ -558,14 +558,25 @@
         return HTTP_BAD_REQUEST;
     urlptr += 3;
     destport = 21;
+    /* strip out the username */
+    if ((strp = strchr(urlptr, '@')) != NULL)
+       urlptr = strp + 1;
     strp = strchr(urlptr, '/');
     if (strp == NULL) {
         desthost = ap_pstrdup(p, urlptr);
         urlptr = "/";
     }
     else {
-        char *q = ap_palloc(p, strp - urlptr + 1);
-        memcpy(q, urlptr, strp - urlptr);
+        char *q, *portptr;
+
+        if ((portptr = strstr(urlptr, ":")) != NULL)
+        {
+            q = ap_palloc(p, portptr - urlptr + 1);
+            destport = atoi(portptr);
+        }
+        else
+            q = ap_palloc(p, strp - urlptr + 1);
+        memcpy(q, urlptr, (portptr ? portptr : strp) - urlptr);
         q[strp - urlptr] = '\0';
         urlptr = strp;
         desthost = q;

Reply via email to