< prev index next >

src/java.base/share/classes/java/security/AccessControlContext.java

Print this page




 441             checkPermission2(perm);
 442             return;
 443         }
 444 
 445         for (int i=0; i< context.length; i++) {
 446             if (context[i] != null &&  !context[i].implies(perm)) {
 447                 if (dumpDebug) {
 448                     debug.println("access denied " + perm);
 449                 }
 450 
 451                 if (Debug.isOn("failure") && debug != null) {
 452                     // Want to make sure this is always displayed for failure,
 453                     // but do not want to display again if already displayed
 454                     // above.
 455                     if (!dumpDebug) {
 456                         debug.println("access denied " + perm);
 457                     }
 458                     Thread.dumpStack();
 459                     final ProtectionDomain pd = context[i];
 460                     final Debug db = debug;
 461                     AccessController.doPrivileged (new PrivilegedAction<Void>() {
 462                         public Void run() {
 463                             db.println("domain that failed "+pd);
 464                             return null;
 465                         }
 466                     });
 467                 }
 468                 throw new AccessControlException("access denied "+perm, perm);
 469             }
 470         }
 471 
 472         // allow if all of them allowed access
 473         if (dumpDebug) {
 474             debug.println("access allowed "+perm);
 475         }
 476 
 477         checkPermission2(perm);
 478     }
 479 
 480     /*
 481      * Check the domains associated with the limited privilege scope.




 441             checkPermission2(perm);
 442             return;
 443         }
 444 
 445         for (int i=0; i< context.length; i++) {
 446             if (context[i] != null &&  !context[i].implies(perm)) {
 447                 if (dumpDebug) {
 448                     debug.println("access denied " + perm);
 449                 }
 450 
 451                 if (Debug.isOn("failure") && debug != null) {
 452                     // Want to make sure this is always displayed for failure,
 453                     // but do not want to display again if already displayed
 454                     // above.
 455                     if (!dumpDebug) {
 456                         debug.println("access denied " + perm);
 457                     }
 458                     Thread.dumpStack();
 459                     final ProtectionDomain pd = context[i];
 460                     final Debug db = debug;
 461                     AccessController.doPrivileged (new PrivilegedAction<>() {
 462                         public Void run() {
 463                             db.println("domain that failed "+pd);
 464                             return null;
 465                         }
 466                     });
 467                 }
 468                 throw new AccessControlException("access denied "+perm, perm);
 469             }
 470         }
 471 
 472         // allow if all of them allowed access
 473         if (dumpDebug) {
 474             debug.println("access allowed "+perm);
 475         }
 476 
 477         checkPermission2(perm);
 478     }
 479 
 480     /*
 481      * Check the domains associated with the limited privilege scope.


< prev index next >