Skip to content

Commit

Permalink
Protect initialization of ResourceLinkFactory when running with a Sec…
Browse files Browse the repository at this point in the history
…urityManager.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1725926 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Konstantin Kolinko committed Jan 21, 2016
1 parent 0a6502c commit 76ebc90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions java/org/apache/naming/factory/ResourceLinkFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public class ResourceLinkFactory
* @param newGlobalContext new global context value
*/
public static void setGlobalContext(Context newGlobalContext) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission(
ResourceLinkFactory.class.getName() + ".setGlobalContext"));
}
globalContext = newGlobalContext;
}

Expand Down
8 changes: 8 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 9.0.0.M3" rtext="In development">
<subsection name="Catalina">
<changelog>
<fix>
Protect initialization of <code>ResourceLinkFactory</code> when
running with a SecurityManager. (kkolinko)
</fix>
</changelog>
</subsection>
</section>
<section name="Tomcat 9.0.0.M2" rtext="Voting in progress">
<subsection name="Catalina">
Expand Down

0 comments on commit 76ebc90

Please sign in to comment.