233 public String run() {
234 return java.security.Security.getProperty
235 ("login.configuration.provider");
236 }
237 });
238 if (config_class == null) {
239 config_class = "sun.security.provider.ConfigFile";
240 }
241
242 try {
243 final String finalClass = config_class;
244 Configuration untrustedImpl = AccessController.doPrivileged(
245 new PrivilegedExceptionAction<>() {
246 public Configuration run() throws ClassNotFoundException,
247 InstantiationException,
248 IllegalAccessException {
249 Class<? extends Configuration> implClass = Class.forName(
250 finalClass, false,
251 Thread.currentThread().getContextClassLoader()
252 ).asSubclass(Configuration.class);
253 return implClass.newInstance();
254 }
255 });
256 AccessController.doPrivileged(
257 new PrivilegedExceptionAction<>() {
258 public Void run() {
259 setConfiguration(untrustedImpl);
260 return null;
261 }
262 }, Objects.requireNonNull(untrustedImpl.acc)
263 );
264 } catch (PrivilegedActionException e) {
265 Exception ee = e.getException();
266 if (ee instanceof InstantiationException) {
267 throw (SecurityException) new
268 SecurityException
269 ("Configuration error:" +
270 ee.getCause().getMessage() +
271 "\n").initCause(ee.getCause());
272 } else {
273 throw (SecurityException) new
|
233 public String run() {
234 return java.security.Security.getProperty
235 ("login.configuration.provider");
236 }
237 });
238 if (config_class == null) {
239 config_class = "sun.security.provider.ConfigFile";
240 }
241
242 try {
243 final String finalClass = config_class;
244 Configuration untrustedImpl = AccessController.doPrivileged(
245 new PrivilegedExceptionAction<>() {
246 public Configuration run() throws ClassNotFoundException,
247 InstantiationException,
248 IllegalAccessException {
249 Class<? extends Configuration> implClass = Class.forName(
250 finalClass, false,
251 Thread.currentThread().getContextClassLoader()
252 ).asSubclass(Configuration.class);
253 @SuppressWarnings("deprecation")
254 Configuration result = implClass.newInstance();
255 return result;
256 }
257 });
258 AccessController.doPrivileged(
259 new PrivilegedExceptionAction<>() {
260 public Void run() {
261 setConfiguration(untrustedImpl);
262 return null;
263 }
264 }, Objects.requireNonNull(untrustedImpl.acc)
265 );
266 } catch (PrivilegedActionException e) {
267 Exception ee = e.getException();
268 if (ee instanceof InstantiationException) {
269 throw (SecurityException) new
270 SecurityException
271 ("Configuration error:" +
272 ee.getCause().getMessage() +
273 "\n").initCause(ee.getCause());
274 } else {
275 throw (SecurityException) new
|