tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Date Thu, 06 Feb 2003 23:34:45 GMT
nacho       2003/02/06 15:34:45

  Modified:    jk/native2/server/isapi jk_isapi_plugin.c
  Log:
  Fix for Bug#16759 ISAPI_REDIRECTOR Handles %2F improperly
  
  Was refusing any URL with %2F or %00  embedded always,
  now it only refuses request mapped to tomcat..
  
  Revision  Changes    Path
  1.57      +19 -18    jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- jk_isapi_plugin.c	6 Feb 2003 16:37:47 -0000	1.56
  +++ jk_isapi_plugin.c	6 Feb 2003 23:34:45 -0000	1.57
  @@ -315,22 +315,6 @@
                   }
   
                   rc = jk_requtil_unescapeUrl(uri);
  -                if (rc == BAD_REQUEST) {
  -                    env->l->jkLog(env, env->l,  JK_LOG_ERROR, 
  -                           "HttpFilterProc [%s] contains one or more invalid escape sequences.\n",

  -                           uri);
  -                    write_error_response(pfc,"400 Bad Request", HTML_ERROR_400);
  -                    workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv, env
);
  -                    return SF_STATUS_REQ_FINISHED;
  -                }
  -                else if(rc == BAD_PATH) {
  -                    env->l->jkLog(env, env->l,  JK_LOG_EMERG, 
  -                           "HttpFilterProc [%s] contains forbidden escape sequences.\n",

  -                           uri);
  -                    write_error_response(pfc,"403 Forbidden", HTML_ERROR_403);
  -                    workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv, env
);
  -                    return SF_STATUS_REQ_FINISHED;
  -                }
                   jk_requtil_getParents(uri);
   
                   if (pfc->GetServerVariable(pfc, SERVER_NAME, (LPVOID)Host, (LPDWORD)&szHost)){
  @@ -354,6 +338,23 @@
                       char *forwardURI;
   
                       /* This is a servlet, should redirect ... */
  +                    /* First check if the request was invalidated at decode */
  +                    if (rc == BAD_REQUEST) {
  +                        env->l->jkLog(env, env->l,  JK_LOG_ERROR, 
  +                            "HttpFilterProc [%s] contains one or more invalid escape sequences.\n",

  +                            uri);
  +                        write_error_response(pfc,"400 Bad Request", HTML_ERROR_400);
  +                        workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv,
env );
  +                        return SF_STATUS_REQ_FINISHED;
  +                    }
  +                    else if(rc == BAD_PATH) {
  +                        env->l->jkLog(env, env->l,  JK_LOG_EMERG, 
  +                            "HttpFilterProc [%s] contains forbidden escape sequences.\n",

  +                            uri);
  +                        write_error_response(pfc,"403 Forbidden", HTML_ERROR_403);
  +                        workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv,
env );
  +                        return SF_STATUS_REQ_FINISHED;
  +                    }
                       env->l->jkLog(env, env->l,  JK_LOG_DEBUG, 
                              "HttpFilterProc [%s] is a servlet url - should redirect to %s\n",

                              uri, uriEnv->workerName);
  @@ -408,7 +409,7 @@
                               workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv,
env );
                               return SF_STATUS_REQ_ERROR;
                           }
  -                    SetHeader(pfc, "Translate:", NULL);
  +                        SetHeader(pfc, "Translate:", NULL);
                       }
                   } else {
                       env->l->jkLog(env, env->l,  JK_LOG_DEBUG, 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message