httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject [PATCH] PR#1092: trailing / and .. entry in ftp proxy
Date Sun, 07 Sep 1997 00:00:44 GMT
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;



Mime
View raw message