Author: markt
Date: Fri Aug 24 13:43:34 2018
New Revision: 1838857
URL: http://svn.apache.org/viewvc?rev=1838857&view=rev
Log:
Further normalization clean-up
Modified:
tomcat/jk/trunk/native/apache-2.0/mod_jk.c
tomcat/jk/trunk/native/common/jk_uri_worker_map.c
tomcat/jk/trunk/native/common/jk_util.c
tomcat/jk/trunk/native/common/jk_util.h
Modified: tomcat/jk/trunk/native/apache-2.0/mod_jk.c
URL:
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?rev=1838857&r1=1838856&r2=1838857&view=diff
==============================================================================
--- tomcat/jk/trunk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c Fri Aug 24 13:43:34 2018
@@ -2791,7 +2791,14 @@ static int jk_handler(request_rec * r)
}
else {
rule_extension_t *e;
- worker_name = map_uri_to_worker_ext(xconf->uw_map, r->uri,
+ char *clean_uri;
+ clean_uri = apr_pstrdup(r->pool, r->uri);
+ rc = jk_servlet_normalize(clean_uri, xconf->log);
+ if (rc != 0) {
+ return HTTP_NOT_FOUND;
+ }
+
+ worker_name = map_uri_to_worker_ext(xconf->uw_map, clean_uri,
NULL, &e, NULL,
xconf->log);
rconf = (jk_request_conf_t
*)ap_get_module_config(r->request_config,
&jk_module);
Modified: tomcat/jk/trunk/native/common/jk_uri_worker_map.c
URL:
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_uri_worker_map.c?rev=1838857&r1=1838856&r2=1838857&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_uri_worker_map.c (original)
+++ tomcat/jk/trunk/native/common/jk_uri_worker_map.c Fri Aug 24 13:43:34 2018
@@ -1175,12 +1175,6 @@ const char *map_uri_to_worker_ext(jk_uri
jk_log(l, JK_LOG_DEBUG, "Found session identifier '%s' in url
'%s'",
url_rewrite, uri);
}
- if (collapse_slashes == JK_COLLAPSE_ALL) {
- /* Remove multiple slashes
- * No need to copy url, because it is local and
- * the unchanged url is no longer needed */
- jk_no2slash(url);
- }
if (JK_IS_DEBUG_LEVEL(l))
jk_log(l, JK_LOG_DEBUG, "Attempting to map URI '%s' from %d maps",
url, IND_THIS(uw_map->size));
@@ -1193,13 +1187,6 @@ const char *map_uri_to_worker_ext(jk_uri
/* In case we found a match, check for the unmounts. */
if (rv >= 0 && IND_THIS(uw_map->nosize)) {
int rc;
- if (collapse_slashes == JK_COLLAPSE_UNMOUNT) {
- /* Remove multiple slashes when looking for
- * unmount to prevent trivial unmount bypass attack.
- * No need to copy url, because it is local and
- * the unchanged url is no longer needed */
- jk_no2slash(url);
- }
/* Again first including vhost. */
rc = is_nomatch(uw_map, url, rv, l);
/* If no unmount was found, try without vhost. */
Modified: tomcat/jk/trunk/native/common/jk_util.c
URL:
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_util.c?rev=1838857&r1=1838856&r2=1838857&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_util.c (original)
+++ tomcat/jk/trunk/native/common/jk_util.c Fri Aug 24 13:43:34 2018
@@ -2177,25 +2177,6 @@ int jk_wildchar_match(const char *str, c
return (str[x] != '\0');
}
-void jk_no2slash(char *name)
-{
- char *d, *s;
-
- s = d = name;
-
- while (*s) {
- if ((*d++ = *s) == '/') {
- do {
- ++s;
- } while (*s == '/');
- }
- else {
- ++s;
- }
- }
- *d = '\0';
-}
-
int jk_servlet_normalize(char *path, jk_logger_t *logger)
{
int l, w;
Modified: tomcat/jk/trunk/native/common/jk_util.h
URL:
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_util.h?rev=1838857&r1=1838856&r2=1838857&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_util.h (original)
+++ tomcat/jk/trunk/native/common/jk_util.h Fri Aug 24 13:43:34 2018
@@ -248,8 +248,6 @@ int is_http_status_fail(unsigned int htt
int jk_wildchar_match(const char *str, const char *exp, int icase);
-void jk_no2slash(char *name);
-
int jk_servlet_normalize(char *path, jk_logger_t *logger);
#define JK_NORMALIZE_BAD_PATH -1
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]