private void checkAccess(Class<?> clazz) { if (privileged) { return; } if (ContainerServlet.class.isAssignableFrom(clazz)) { throw new SecurityException(sm.getString( "defaultInstanceManager.restrictedContainerServlet", clazz)); } while (clazz != null) { if (restrictedClasses.contains(clazz.getName())) { throw new SecurityException(sm.getString( "defaultInstanceManager.restrictedClass", clazz)); } clazz = clazz.getSuperclass(); } }
/** * Return <code>true</code> if the specified class name represents a * container provided servlet class that should be loaded by the * server class loader. * * @param classname Name of the class to be checked */ protected boolean isContainerProvidedServlet(String classname) { if (classname.startsWith("org.apache.catalina.")) { return (true); } try { Class<?> clazz = this.getClass().getClassLoader().loadClass(classname); return (ContainerServlet.class.isAssignableFrom(clazz)); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); return (false); } }
/** * Return <code>true</code> if loading this servlet is allowed. */ private boolean isServletAllowed(Object servlet) { if (servlet instanceof ContainerServlet) { if (((Context) getParent()).getPrivileged() || (servlet.getClass().getName().equals ("org.apache.catalina.servlets.InvokerServlet"))) { return (true); } else { return (false); } } return (true); }
private void checkAccess(Class<?> clazz) { if (privileged) { return; } if (Filter.class.isAssignableFrom(clazz)) { checkAccess(clazz, restrictedFilters); } else if (Servlet.class.isAssignableFrom(clazz)) { if (ContainerServlet.class.isAssignableFrom(clazz)) { throw new SecurityException("Restricted (ContainerServlet) " + clazz); } checkAccess(clazz, restrictedServlets); } else { checkAccess(clazz, restrictedListeners); } }
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { if (className.startsWith("org.apache.catalina")) { return containerClassLoader.loadClass(className); } try { Class<?> clazz = containerClassLoader.loadClass(className); if (ContainerServlet.class.isAssignableFrom(clazz)) { return clazz; } } catch (Throwable t) { ExceptionUtils.handleThrowable(t); } return classLoader.loadClass(className); }
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { if (className.startsWith("org.apache.catalina")) { return containerClassLoader.loadClass(className); } try { Class<?> clazz = containerClassLoader.loadClass(className); if (ContainerServlet.class.isAssignableFrom(clazz)) { return clazz; } } catch (Throwable t) { //ignore } return classLoader.loadClass(className); }
/** * Return <code>true</code> if the specified class name represents a * container provided servlet class that should be loaded by the * server class loader. * * @param classname Name of the class to be checked */ protected boolean isContainerProvidedServlet(String classname) { if (classname.startsWith("org.apache.catalina.")) { return (true); } try { Class clazz = this.getClass().getClassLoader().loadClass(classname); return (ContainerServlet.class.isAssignableFrom(clazz)); } catch (Throwable t) { return (false); } }
/** * Return <code>true</code> if the specified class name represents a * container provided servlet class that should be loaded by the * server class loader. * * @param name Name of the class to be checked */ private boolean isContainerProvidedServlet(String classname) { if (classname.startsWith("org.apache.catalina.")) { return (true); } try { Class clazz = this.getClass().getClassLoader().loadClass(classname); return (ContainerServlet.class.isAssignableFrom(clazz)); } catch (Throwable t) { return (false); } }
private void checkAccess(Class<?> clazz) { if (privileged) { return; } if (ContainerServlet.class.isAssignableFrom(clazz)) { throw new SecurityException(sm.getString("defaultInstanceManager.restrictedContainerServlet", clazz)); } while (clazz != null) { if (restrictedClasses.contains(clazz.getName())) { throw new SecurityException(sm.getString("defaultInstanceManager.restrictedClass", clazz)); } clazz = clazz.getSuperclass(); } }
/** * Return <code>true</code> if the specified class name represents a * container provided servlet class that should be loaded by the server * class loader. * * @param classname * Name of the class to be checked */ protected boolean isContainerProvidedServlet(String classname) { if (classname.startsWith("org.apache.catalina.")) { return (true); } try { Class<?> clazz = this.getClass().getClassLoader().loadClass(classname); return (ContainerServlet.class.isAssignableFrom(clazz)); } catch (Throwable t) { ExceptionUtils.handleThrowable(t); return (false); } }
private void checkAccess(Class<?> clazz) { if (privileged) return; if (Filter.class.isAssignableFrom(clazz)) { checkAccess(clazz, restrictedFilters); } else if (Servlet.class.isAssignableFrom(clazz)) { if (ContainerServlet.class.isAssignableFrom(clazz)) { throw new SecurityException("Restricted (ContainerServlet) " + clazz); } checkAccess(clazz, restrictedServlets); } else { checkAccess(clazz, restrictedListeners); } }