During the fix for 4215035, I assumed that the the java.ext.dirs/*
would be expanded correctly, but it is not. This needs to be fixed.
The following shows the problem.
/*
* This is a trivial file to grab the security manager, grab a
* permission object, then try to check the resulting permission.
*/
import java.io.*;
import java.security.*;
public class Ext_AllPolicy {
public static void main (String[] args) {
FilePermission mine = new FilePermission("/tmp/bar", "read");
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(mine);
}
}
}
206 15:48 javac Ext_AllPolicy.java
208 15:48 jar -cvf brad.jar Ext_AllPolicy.class
209 15:48 mv brad.jar /tmp
217 15:51 java -Djava.security.manager -Djava.ext.dirs="/tmp" Ext_AllPolicy
This works as expected.
218 15:51 java -Djava.security.manager -Djava.ext.dirs=".:/tmp" Ext_AllPolicy
This does not, the only difference is the java.ext.dirs:
java -Djava.security.manager -Djava.ext.dirs=".:/tmp" Ext_AllPolicy
Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission /tmp/bar read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java, Compiled Code)
at java.security.AccessController.checkPermission(AccessController.java, Compiled Code)
at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled Code)
at Ext_AllPolicy.main(Ext_AllPolicy.java, Compiled Code)