1 17 18 19 package org.apache.catalina.security; 20 21 30 31 public final class SecurityClassLoad { 32 33 public static void securityClassLoad(ClassLoader loader) 34 throws Exception { 35 36 if( System.getSecurityManager() == null ){ 37 return; 38 } 39 40 loadCorePackage(loader); 41 loadLoaderPackage(loader); 42 loadSessionPackage(loader); 43 loadUtilPackage(loader); 44 loadJavaxPackage(loader); 45 loadCoyotePackage(loader); 46 loadHttp11Package(loader); 47 } 48 49 50 private final static void loadCorePackage(ClassLoader loader) 51 throws Exception { 52 String basePackage = "org.apache.catalina."; 53 loader.loadClass 54 (basePackage + 55 "core.ApplicationContextFacade$1"); 56 loader.loadClass 57 (basePackage + 58 "core.ApplicationDispatcher$PrivilegedForward"); 59 loader.loadClass 60 (basePackage + 61 "core.ApplicationDispatcher$PrivilegedInclude"); 62 loader.loadClass 63 (basePackage + 64 "core.ContainerBase$PrivilegedAddChild"); 65 loader.loadClass 66 (basePackage + 67 "core.StandardWrapper$1"); 68 } 69 70 71 private final static void loadLoaderPackage(ClassLoader loader) 72 throws Exception { 73 String basePackage = "org.apache.catalina."; 74 loader.loadClass 75 (basePackage + 76 "loader.WebappClassLoader$PrivilegedFindResource"); 77 } 78 79 80 private final static void loadSessionPackage(ClassLoader loader) 81 throws Exception { 82 String basePackage = "org.apache.catalina."; 83 loader.loadClass 84 (basePackage + "session.StandardSession"); 85 loader.loadClass 86 (basePackage + 87 "session.StandardSession$1"); 88 loader.loadClass 89 (basePackage + 90 "session.StandardManager$PrivilegedDoUnload"); 91 } 92 93 94 private final static void loadUtilPackage(ClassLoader loader) 95 throws Exception { 96 String basePackage = "org.apache.catalina."; 97 loader.loadClass 98 (basePackage + "util.URL"); 99 loader.loadClass(basePackage + "util.Enumerator"); 100 } 101 102 103 private final static void loadJavaxPackage(ClassLoader loader) 104 throws Exception { 105 loader.loadClass("javax.servlet.http.Cookie"); 106 } 107 108 109 private final static void loadHttp11Package(ClassLoader loader) 110 throws Exception { 111 String basePackage = "org.apache.coyote.http11."; 112 loader.loadClass(basePackage + "Http11Processor$1"); 113 loader.loadClass(basePackage + "InternalOutputBuffer$1"); 114 loader.loadClass(basePackage + "InternalOutputBuffer$2"); 115 } 116 117 118 private final static void loadCoyotePackage(ClassLoader loader) 119 throws Exception { 120 String basePackage = "org.apache.catalina.connector."; 121 loader.loadClass 122 (basePackage + 123 "RequestFacade$GetAttributePrivilegedAction"); 124 loader.loadClass 125 (basePackage + 126 "RequestFacade$GetParameterMapPrivilegedAction"); 127 loader.loadClass 128 (basePackage + 129 "RequestFacade$GetRequestDispatcherPrivilegedAction"); 130 loader.loadClass 131 (basePackage + 132 "RequestFacade$GetParameterPrivilegedAction"); 133 loader.loadClass 134 (basePackage + 135 "RequestFacade$GetParameterNamesPrivilegedAction"); 136 loader.loadClass 137 (basePackage + 138 "RequestFacade$GetParameterValuePrivilegedAction"); 139 loader.loadClass 140 (basePackage + 141 "RequestFacade$GetCharacterEncodingPrivilegedAction"); 142 loader.loadClass 143 (basePackage + 144 "RequestFacade$GetHeadersPrivilegedAction"); 145 loader.loadClass 146 (basePackage + 147 "RequestFacade$GetHeaderNamesPrivilegedAction"); 148 loader.loadClass 149 (basePackage + 150 "RequestFacade$GetCookiesPrivilegedAction"); 151 loader.loadClass 152 (basePackage + 153 "RequestFacade$GetLocalePrivilegedAction"); 154 loader.loadClass 155 (basePackage + 156 "RequestFacade$GetLocalesPrivilegedAction"); 157 loader.loadClass 158 (basePackage + 159 "ResponseFacade$SetContentTypePrivilegedAction"); 160 loader.loadClass 161 (basePackage + 162 "ResponseFacade$DateHeaderPrivilegedAction"); 163 loader.loadClass 164 (basePackage + 165 "RequestFacade$GetSessionPrivilegedAction"); 166 loader.loadClass 167 (basePackage + 168 "ResponseFacade$1"); 169 loader.loadClass 170 (basePackage + 171 "OutputBuffer$1"); 172 loader.loadClass 173 (basePackage + 174 "CoyoteInputStream$1"); 175 loader.loadClass 176 (basePackage + 177 "CoyoteInputStream$2"); 178 loader.loadClass 179 (basePackage + 180 "CoyoteInputStream$3"); 181 loader.loadClass 182 (basePackage + 183 "CoyoteInputStream$4"); 184 loader.loadClass 185 (basePackage + 186 "CoyoteInputStream$5"); 187 loader.loadClass 188 (basePackage + 189 "InputBuffer$1"); 190 loader.loadClass 191 (basePackage + 192 "Response$1"); 193 loader.loadClass 194 (basePackage + 195 "Response$2"); 196 loader.loadClass 197 (basePackage + 198 "Response$3"); 199 } 200 201 } 202 203 | Popular Tags |