aspose file tools*
The moose likes Java in General and the fly likes How let Policy override ProtectionDomains added by a classloader? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How let Policy override ProtectionDomains added by a classloader?" Watch "How let Policy override ProtectionDomains added by a classloader?" New topic
Author

How let Policy override ProtectionDomains added by a classloader?

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I wrote a little test where I have my Policy grant code in Test.jar only permission to read files, no writing. Then I had a custom ClassLoader load that class and set its protectiondomain to include permission to write a file. The class then attempted to write a file and it passed. When that same class was loaded by a non-custom classloader, it did not pass but threw an exception (just wanted to be sure the test was correct).
To me, this violates the administrator's understanding of what the security policy will be for the JVM. It SHOULD be only what is in my Policy. Does anyone know if there is a way to give the Policy final say? To "nullify" any ProtectionDomains added by a ClassLoader?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How let Policy override ProtectionDomains added by a classloader?