You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/09/07 02:00:44 UTC

[PATCH] PR#1092: trailing / and .. entry in ftp proxy

Try to access "ftp://host/pub/" in the proxy, and note that the .. link
points to "ftp://host/pub".  The below patch fixes it.

Index: modules/proxy/proxy_ftp.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/proxy/proxy_ftp.c,v
retrieving revision 1.37
diff -u -r1.37 proxy_ftp.c
--- proxy_ftp.c	1997/09/06 14:16:57	1.37
+++ proxy_ftp.c	1997/09/06 23:49:36
@@ -340,6 +340,9 @@
                 
                 strncpy(newpath, path, sizeof(newpath)-1);
 		newpath[sizeof(newpath)-1] = '\0';
+		/* strip trailing '/' */
+                if (newpath[strlen(newpath)-1] == '/') 
+		    newpath[strlen(newpath)-1] = '\0';
                 newfile=strrchr(newpath,'/');
                 if (newfile) *(newfile)=0;
                 else newpath[0]=0;