Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

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/tc8.0.x/trunk@1725929 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Konstantin Kolinko committed Jan 21, 2016
1 parent 0067d0e commit 0531f7a
Show file tree
Hide file tree
Showing 2 changed files with 9 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
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@
<bug>58900</bug>: Correctly undeploy symlinked resources and prevent an
infinite cycle of deploy / undeploy. (markt)
</fix>
<fix>
Protect initialization of <code>ResourceLinkFactory</code> when
running with a SecurityManager. (kkolinko)
</fix>
</changelog>
</subsection>
<subsection name="Jasper">
Expand Down

0 comments on commit 0531f7a

Please sign in to comment.