From: William A. Rowe Jr Date: Thu, 12 Oct 2000 14:22:30 +0000 (+0000) Subject: Move more path parsing fixes forward from 1.3 X-Git-Tag: APACHE_2_0_ALPHA_8~386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c792f50d0ab42d10c167d8c4f5f4f7e56c0a0c08;p=apache Move more path parsing fixes forward from 1.3 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86564 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/os/os2/os-inline.c b/os/os2/os-inline.c index fc165e8322..f9a660d16c 100644 --- a/os/os2/os-inline.c +++ b/os/os2/os-inline.c @@ -85,8 +85,10 @@ INLINE int ap_os_is_path_absolute(const char *file) { - /* For now, just do the same check that http_request.c and mod_alias.c - * do. + /* For now, just do the same check that http_request.c and mod_alias.c do. + * XXX: Accept /bleh still? Or do we concur that d:/bleh is a minimum + * requirement? If so, canonical name needs to convert to drive/path + * syntax, and the test becomes (file[0] == '/' && file[1] == '/') ||... */ - return file && (file[0] == '/' || file[1] == ':'); + return file && (file[0] == '/' || (file[1] == ':' && file[2] == '/')); } diff --git a/os/win32/os.h b/os/win32/os.h index da88ddb543..295a03042f 100644 --- a/os/win32/os.h +++ b/os/win32/os.h @@ -137,10 +137,12 @@ typedef char * caddr_t; __inline int ap_os_is_path_absolute(const char *file) { - /* For now, just do the same check that http_request.c and mod_alias.c - * do. + /* For now, just do the same check that http_request.c and mod_alias.c do. + * XXX: Accept /bleh still? Or do we concur that d:/bleh is a minimum + * requirement? If so, canonical name needs to convert to drive/path + * syntax, and the test becomes (file[0] == '/' && file[1] == '/') ||... */ - return file[0] == '/' || file[1] == ':'; + return file && (file[0] == '/' || (file[1] == ':' && file[2] == '/')); } /* OS-dependent filename routines in util_win32.c */