Skip to content

Commit 2d69fde

Browse files
committed
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk@1823309 13f79535-47bb-0310-9956-ffa450edef68
1 parent 67e8c72 commit 2d69fde

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

java/org/apache/catalina/realm/RealmBase.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,9 @@ public void backgroundProcess() {
688688

689689
// Check each defined security constraint
690690
String uri = request.getRequestPathMB().toString();
691-
// Bug47080 - in rare cases this may be null
691+
// Bug47080 - in rare cases this may be null or ""
692692
// Mapper treats as '/' do the same to prevent NPE
693-
if (uri == null) {
693+
if (uri == null || uri.length() == 0) {
694694
uri = "/";
695695
}
696696

@@ -722,7 +722,8 @@ public void backgroundProcess() {
722722
}
723723

724724
for(int k=0; k < patterns.length; k++) {
725-
if(uri.equals(patterns[k])) {
725+
// Exact match including special case for the context root.
726+
if(uri.equals(patterns[k]) || patterns[k].length() == 0 && uri.equals("/")) {
726727
found = true;
727728
if(collection[j].findMethod(method)) {
728729
if(results == null) {

webapps/docs/changelog.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
rather than the user facing Principal object as Tomcat requires the
8383
internal object to correctly process later authorization checks. (markt)
8484
</fix>
85+
<fix>
86+
<bug>62067</bug>: Correctly apply security constraints mapped to the
87+
context root using a URL pattern of <code>&quot;&quot;</code>. (markt)
88+
</fix>
8589
</changelog>
8690
</subsection>
8791
<subsection name="Other">

0 commit comments

Comments
 (0)