428 TRAPS) { |
428 TRAPS) { |
429 if(!has_checkPackageAccess()) return; |
429 if(!has_checkPackageAccess()) return; |
430 |
430 |
431 // Now we have to call back to java to check if the initating class has access |
431 // Now we have to call back to java to check if the initating class has access |
432 JavaValue result(T_VOID); |
432 JavaValue result(T_VOID); |
433 if (TraceProtectionDomainVerification) { |
433 if (log_is_enabled(Debug, protectiondomain)) { |
|
434 ResourceMark rm; |
434 // Print out trace information |
435 // Print out trace information |
435 tty->print_cr("Checking package access"); |
436 outputStream* log = LogHandle(protectiondomain)::debug_stream(); |
436 tty->print(" - class loader: "); class_loader()->print_value_on(tty); tty->cr(); |
437 log->print_cr("Checking package access"); |
437 tty->print(" - protection domain: "); protection_domain()->print_value_on(tty); tty->cr(); |
438 log->print("class loader: "); class_loader()->print_value_on(log); |
438 tty->print(" - loading: "); klass()->print_value_on(tty); tty->cr(); |
439 log->print(" protection domain: "); protection_domain()->print_value_on(log); |
|
440 log->print(" loading: "); klass()->print_value_on(log); |
|
441 log->cr(); |
439 } |
442 } |
440 |
443 |
441 KlassHandle system_loader(THREAD, SystemDictionary::ClassLoader_klass()); |
444 KlassHandle system_loader(THREAD, SystemDictionary::ClassLoader_klass()); |
442 JavaCalls::call_special(&result, |
445 JavaCalls::call_special(&result, |
443 class_loader, |
446 class_loader, |
446 vmSymbols::class_protectiondomain_signature(), |
449 vmSymbols::class_protectiondomain_signature(), |
447 Handle(THREAD, klass->java_mirror()), |
450 Handle(THREAD, klass->java_mirror()), |
448 protection_domain, |
451 protection_domain, |
449 THREAD); |
452 THREAD); |
450 |
453 |
451 if (TraceProtectionDomainVerification) { |
454 if (HAS_PENDING_EXCEPTION) { |
452 if (HAS_PENDING_EXCEPTION) { |
455 log_debug(protectiondomain)("DENIED !!!!!!!!!!!!!!!!!!!!!"); |
453 tty->print_cr(" -> DENIED !!!!!!!!!!!!!!!!!!!!!"); |
456 } else { |
454 } else { |
457 log_debug(protectiondomain)("granted"); |
455 tty->print_cr(" -> granted"); |
|
456 } |
|
457 tty->cr(); |
|
458 } |
458 } |
459 |
459 |
460 if (HAS_PENDING_EXCEPTION) return; |
460 if (HAS_PENDING_EXCEPTION) return; |
461 |
461 |
462 // If no exception has been thrown, we have validated the protection domain |
462 // If no exception has been thrown, we have validated the protection domain |