Loading server/core.c +4 −18 Changes for server/core.c: 4 added lines, 18 removed lines. Original line number Diff line number Diff line Loading @@ -4062,6 +4062,7 @@ AP_INIT_TAKE1("TraceEnable", set_trace_enable, NULL, RSRC_CONF, AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) { apr_status_t rv; char *path; /* XXX this seems too specific, this should probably become * some general-case test Loading @@ -4081,24 +4082,11 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) || r->uri[r->server->pathlen] == '/' || r->uri[r->server->pathlen] == '\0')) { /* skip all leading /'s (e.g. http://localhost///foo) * so we are looking at only the relative path. */ char *path = r->uri + r->server->pathlen; while (*path == '/') { ++path; } if ((rv = apr_filepath_merge(&r->filename, ap_document_root(r), path, APR_FILEPATH_TRUENAME | APR_FILEPATH_SECUREROOT, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "Cannot map %s to file", r->the_request); return HTTP_FORBIDDEN; } r->canonical_filename = r->filename; path = r->uri + r->server->pathlen; } else { path = r->uri; } /* * Make sure that we do not mess up the translation by adding two * /'s in a row. This happens under windows when the document Loading @@ -4107,7 +4095,6 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) /* skip all leading /'s (e.g. http://localhost///foo) * so we are looking at only the relative path. */ char *path = r->uri; while (*path == '/') { ++path; } Loading @@ -4120,7 +4107,6 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) return HTTP_FORBIDDEN; } r->canonical_filename = r->filename; } return OK; } Loading Loading
server/core.c +4 −18 Changes for server/core.c: 4 added lines, 18 removed lines. Original line number Diff line number Diff line Loading @@ -4062,6 +4062,7 @@ AP_INIT_TAKE1("TraceEnable", set_trace_enable, NULL, RSRC_CONF, AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) { apr_status_t rv; char *path; /* XXX this seems too specific, this should probably become * some general-case test Loading @@ -4081,24 +4082,11 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) || r->uri[r->server->pathlen] == '/' || r->uri[r->server->pathlen] == '\0')) { /* skip all leading /'s (e.g. http://localhost///foo) * so we are looking at only the relative path. */ char *path = r->uri + r->server->pathlen; while (*path == '/') { ++path; } if ((rv = apr_filepath_merge(&r->filename, ap_document_root(r), path, APR_FILEPATH_TRUENAME | APR_FILEPATH_SECUREROOT, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "Cannot map %s to file", r->the_request); return HTTP_FORBIDDEN; } r->canonical_filename = r->filename; path = r->uri + r->server->pathlen; } else { path = r->uri; } /* * Make sure that we do not mess up the translation by adding two * /'s in a row. This happens under windows when the document Loading @@ -4107,7 +4095,6 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) /* skip all leading /'s (e.g. http://localhost///foo) * so we are looking at only the relative path. */ char *path = r->uri; while (*path == '/') { ++path; } Loading @@ -4120,7 +4107,6 @@ AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r) return HTTP_FORBIDDEN; } r->canonical_filename = r->filename; } return OK; } Loading