Bug 118184 - WAF Running under a context other than root
WAF Running under a context other than root
Status: NEW
Product: Red Hat Web Application Framework
Classification: Retired
Component: other (Show other bugs)
nightly
All Linux
medium Severity medium
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-12 16:48 EST by Brett Prucha
Modified: 2008-05-01 11:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brett Prucha 2004-03-12 16:48:45 EST
Description of problem:

There are a number of issues that I've found trying to run WAF under 
another context other than root.  These problems have been around for 
a while so I'm assuming you are not testing these cases at all.


The issues I have found in the nightly build so far are...

Issue 1:

SiteNodeDispatcher line 200 should be:

    prefix = requestURL.getServletPath();

When you create SiteNodeRequestContext as

        final SiteNodeRequestContext snrc = new SiteNodeRequestContext
            (req, rc, sn, prefix + sn.getURL());

SiteNodeRequestContext sets remainingUrl to InitialRequestContext 
RemainingURLPart is the URL with the context stipped out of it.  If 
you pass into SiteNodeRequestContext a prefix with the context in it 
again you end up with a pretty funky RemainingURLPart that will not 
work.


Issue 2:

login_en.xsl and user-banner.xsl need to be using ${context-prefix}


Issue 3:

CacheServlet on line 181 needs to include the context in the url
    final String url = "http://" + host +
        Web.getConfig().getDispatcherContextPath() + SERVLET_URL + 
        params;


Issue 4:

DefaultSecurityHelper line 62 needs to be:
    String url = req.getPathInfo();

req.getRequestURI(); contains the context and when you compare that 
to whats in allowedPages w/o the context you aren't going to get any 
matches.


Issue 5:

PatternStylesheetResolver should have a context pattern.  Also 
WebAppPatternGenerator will always return "ROOT" for legacy 
dispatchers but that might not always be the case.  I placed mine 
under "ccm" instead of "ROOT" so it would load under the ccm context 
and the PatternStylesheetResolver could not find the stylesheets and 
the only way around it was to hardcode in the context in stylesheet-
paths.txt
Comment 1 Brett Prucha 2004-03-17 15:43:45 EST
A couple more notes on this:

For Issue 3:

I would change line 181 of CacheServlet to support other schemes:

    final String url = Web.getConfig().getDefaultScheme() + "://" +
        host + Web.getConfig().getDispatcherContextPath() +
        SERVLET_URL + params;


for Issue 5:

I changed WebAppPatternGenerator.generateValues line 39 to:

    String ctx = app == null ? Web.getConfig()
        .getDispatcherContextPath() : app.getContextPath();

and the if statement that follows that to:

        if (app == null &&
            (ctx == null ||
            "".equals(ctx))) {
            return new String[] { Web.ROOT_WEBAPP };
        }


Issue 6:

Templating.transformURL should add a line after 338

    path = path.substring(Web.getConfig().
        getDispatcherContextPath().length());


Note You need to log in before you can comment on or make changes to this bug.