/** * Return the <code>HttpSession</code> for which this object is the facade. */ @Override @SuppressWarnings("unchecked") public HttpSession getSession() { if (facade == null) { if (SecurityUtil.isPackageProtectionEnabled()) { final DeltaSession fsession = this; facade = (DeltaSessionFacade) AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { return new DeltaSessionFacade(fsession); } }); } else { facade = new DeltaSessionFacade(this); } } return (facade); }
/** * Set the security package access/protection. */ protected void setSecurityProtection(){ SecurityConfig securityConfig = SecurityConfig.newInstance(); securityConfig.setPackageDefinition(); securityConfig.setPackageAccess(); }
/** * Set the security package.access value. */ public void setPackageAccess(){ // If catalina.properties is missing, protect all by default. if (packageAccess == null){ setSecurityProperty("package.access", PACKAGE_ACCESS); } else { setSecurityProperty("package.access", packageAccess); } }
/** * Returns the singleton instance of that class. * @return an instance of that class. */ public static SecurityConfig newInstance(){ if (singleton == null){ //因为这个类是在刚启动时由一个线程调用,所以不会存在并发问题,无需同步 singleton = new SecurityConfig(); } return singleton; }
/** * Perform work as a particular </code>Subject</code>. Here the work * will be granted to a <code>null</code> subject. * * @param methodName the method to apply the security restriction * @param targetObject the <code>Servlet</code> on which the method will * be called. */ public static void doAsPrivilege(final String methodName, final Servlet targetObject) throws java.lang.Exception{ doAsPrivilege(methodName, targetObject, null, null, null); }
/** * Execute the security checks. Each check should be in a separate method. */ protected void doChecks() { checkOsUser(); checkUmask(); }
/** * Set the security package access/protection. */ protected void setSecurityProtection(){ SecurityConfig securityConfig = SecurityConfig.newInstance(); securityConfig.setPackageDefinition(); securityConfig.setPackageAccess(); }
/** * Set the security package.definition value. */ public void setPackageDefinition(){ // If catalina.properties is missing, protect all by default. if (packageDefinition == null){ setSecurityProperty("package.definition", PACKAGE_DEFINITION); } else { setSecurityProperty("package.definition", packageDefinition); } }
/** * Returns the singleton instance of that class. * @return an instance of that class. */ public static SecurityConfig newInstance(){ if (singleton == null){ singleton = new SecurityConfig(); } return singleton; }
/** * Perform work as a particular </code>Subject</code>. Here the work * will be granted to a <code>null</code> subject. * * @param methodName the method to apply the security restriction * @param targetObject the <code>Servlet</code> on which the method will * be called. */ public static void doAsPrivilege(final String methodName, final Servlet targetObject) throws java.lang.Exception{ doAsPrivilege(methodName, targetObject, null, null, null); }
/** * Set the security package access/protection. */ protected void setSecurityProtection(){ SecurityConfig securityConfig = SecurityConfig.newInstance(); securityConfig.setPackageDefinition(); securityConfig.setPackageAccess(); }
/** * Set the security package.access value. */ public void setPackageAccess(){ // If catalina.properties is missing, protect all by default. if (packageAccess == null){ setSecurityProperty("package.access", PACKAGE_ACCESS); } else { setSecurityProperty("package.access", packageAccess); } }
/** * Returns the singleton instance of that class. * @return an instance of that class. */ public static SecurityConfig newInstance(){ if (singleton == null){ singleton = new SecurityConfig(); } return singleton; }
/** * Perform work as a particular </code>Subject</code>. Here the work * will be granted to a <code>null</code> subject. * * @param methodName the method to apply the security restriction * @param targetObject the <code>Servlet</code> on which the method will * be called. */ public static void doAsPrivilege(final String methodName, final Servlet targetObject) throws java.lang.Exception{ doAsPrivilege(methodName, targetObject, null, null, null); }
/** * Set the security package access/protection. */ protected void setSecurityProtection(){ SecurityConfig securityConfig = SecurityConfig.newInstance(); securityConfig.setPackageDefinition(); securityConfig.setPackageAccess(); }
/** * Set the security package.definition value. */ public void setPackageDefinition(){ // If catalina.properties is missing, protect all by default. if (packageDefinition == null){ setSecurityProperty("package.definition", PACKAGE_DEFINITION); } else { setSecurityProperty("package.definition", packageDefinition); } }
/** * Returns the singleton instance of that class. * @return an instance of that class. */ public static SecurityConfig newInstance(){ if (singleton == null){ singleton = new SecurityConfig(); } return singleton; }
/** * Set the security package access/protection. */ protected void setSecurityProtection(){ SecurityConfig securityConfig = SecurityConfig.newInstance(); securityConfig.setPackageDefinition(); securityConfig.setPackageAccess(); }
/** * Set the security package.access value. */ public void setPackageAccess(){ // If catalina.properties is missing, protect all by default. if (packageAccess == null){ setSecurityProperty("package.access", PACKAGE_ACCESS); } else { setSecurityProperty("package.access", packageAccess); } }
/** * Set the security package.definition value. */ public void setPackageDefinition(){ // If catalina.properties is missing, protect all by default. if (packageDefinition == null){ setSecurityProperty("package.definition", PACKAGE_DEFINITION); } else { setSecurityProperty("package.definition", packageDefinition); } }