httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject [patch] 1.3.15 ap_os_is_path_absolute
Date Wed, 01 Nov 2000 21:00:13 GMT
From: "William A. Rowe, Jr." <wrowe@rowe-clan.net>
Sent: Wednesday, November 01, 2000 2:13 PM

> Users are frequently reporting that their module/handler/alias
> absolute paths are being concatinated onto the server root.
> This is because 1.3.14 now refuses to believe in backslashes
> under win32, and it's up to the front end to deal with them.
> 
> Solution 3: My own - simply change both the ap_set_file_slot and 
> ap_server_root_relative functions pass the file arg through the
> ap_canonicalize_filename function before testing that it is/isn't
> absolute.  I'm +1, since it's a smaller, tighter patch.  It also
> helps third party authors and prevents them from thinking about this
> issue entirely.

Here's the patch... Brian, do you want to drop it in as-is and just
check out the behavior on OS2?

Index: main/http_config.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_config.c,v
retrieving revision 1.154
diff -u -r1.154 http_config.c
--- main/http_config.c 2000/10/03 16:39:40 1.154
+++ main/http_config.c 2000/11/01 20:28:01
@@ -1090,6 +1090,7 @@
        so the server can be moved or mirrored with less pain.  */
     char *p;
     int offset = (int) (long) cmd->info;
+    arg = ap_os_canonical_filename(cmd->pool, arg);
     if (ap_os_is_path_absolute(arg))
  p = arg;
     else
@@ -1108,6 +1109,7 @@
 
 API_EXPORT(char *) ap_server_root_relative(pool *p, char *file)
 {
+    file = ap_os_canonical_filename(p, file);
     if(ap_os_is_path_absolute(file))
  return file;
     return ap_make_full_path(p, ap_server_root, file);



Mime
View raw message