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 22:17:04 GMT

Here is the final patch to fix the naming issues for both
aliases (except for regex aliases!) and general config
directive paths.

I've bashed on it and will commit tommorow bright and early
unless anyone screams (yes - it's rtc... so review :-)

Similar patches to appear in 2.0 will actually rely on
the canonical functions which are still WIP.

With these two patches I'm about ready to sign off on the
1.3.15 bugfix release, but I have to reload the Win95 OS 
on my desktop to debug the cgi execution errors on Win95, 
since Win98 apparently cooperates with the existing code.

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 22:10:50
@@ -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);
Index: modules/standard/mod_alias.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_alias.c,v
retrieving revision 1.41
diff -u -r1.41 mod_alias.c
--- modules/standard/mod_alias.c 1999/05/21 12:16:26 1.41
+++ modules/standard/mod_alias.c 2000/11/01 22:10:56
@@ -137,10 +137,12 @@
  new->regexp = ap_pregcomp(cmd->pool, f, REG_EXTENDED);
  if (new->regexp == NULL)
      return "Regular expression could not be compiled.";
+        new->real = r;
     }
+    else
+        new->real = ap_os_canonical_filename(cmd->pool, r);
 
     new->fake = f;
-    new->real = r;
     new->handler = cmd->info;
 
     return NULL;
@@ -233,7 +235,7 @@
      "a fakename and a realname"},
     {"Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
      OR_FILEINFO, TAKE23,
-  "an optional status, then document to be redirected and destination URL"},
+     "an optional status, then document to be redirected and destination URL"},
     {"AliasMatch", add_alias_regex, NULL, RSRC_CONF, TAKE2,
      "a regular expression and a filename"},
     {"ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF, TAKE2,
@@ -339,7 +341,6 @@
 
      return found;
  }
-
     }
 
     return NULL;



Mime
View raw message