From c792f50d0ab42d10c167d8c4f5f4f7e56c0a0c08 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 12 Oct 2000 14:22:30 +0000 Subject: [PATCH] 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 --- os/os2/os-inline.c | 8 +++++--- os/win32/os.h | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) 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 */ -- 2.50.1