Skip to content

Commit

Permalink
Simplify construction of appName from container name in JAASRealm.
Browse files Browse the repository at this point in the history
There is no need to add a slash in front of the container name as
the method makeLegalForJAAS will strip it off directly afterwards.
That removes the need for a temporary variable.


git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1837787 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
FSchumacher committed Aug 10, 2018
1 parent d6191c4 commit 27a2116
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions java/org/apache/catalina/realm/JAASRealm.java
Expand Up @@ -227,13 +227,7 @@ public void setContainer(Container container) {
super.setContainer(container);

if( appName==null ) {
String name = container.getName();
if (!name.startsWith("/")) {
name = "/" + name;
}
name = makeLegalForJAAS(name);

appName=name;
appName = makeLegalForJAAS(container.getName());

log.info("Set JAAS app name " + appName);
}
Expand Down
3 changes: 3 additions & 0 deletions webapps/docs/changelog.xml
Expand Up @@ -106,6 +106,9 @@
<fix>
Use short circuit logic to prevent potential NPE in CorsFilter. (fschumacher)
</fix>
<scode>
Simplify construction of appName from container name in JAASRealm. (fschumacher)
</scode>
</changelog>
</subsection>
<subsection name="Coyote">
Expand Down

0 comments on commit 27a2116

Please sign in to comment.