~ubuntu-branches/debian/sid/tomcat6/sid

« back to all changes in this revision

Viewing changes to java/org/apache/naming/ContextAccessController.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-05-22 10:03:04 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20140522100304-mihmp51mlvi4mr0m
Tags: 6.0.41-1
* New upstream release.
  - Refreshed the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * Handles the access control on the JNDI contexts.
25
25
 *
26
26
 * @author Remy Maucherat
27
 
 * @version $Id: ContextAccessController.java 939511 2010-04-29 23:48:20Z kkolinko $
 
27
 *
28
28
 */
29
29
 
30
30
public class ContextAccessController {
55
55
     * @param token Security token
56
56
     */
57
57
    public static void setSecurityToken(Object name, Object token) {
 
58
        SecurityManager sm = System.getSecurityManager();
 
59
        if (sm != null) {
 
60
            sm.checkPermission(new RuntimePermission(
 
61
                    ContextAccessController.class.getName()
 
62
                            + ".setSecurityToken"));
 
63
        }
58
64
        if ((!securityTokens.containsKey(name)) && (token != null)) {
59
65
            securityTokens.put(name, token);
60
66
        }