JDK-4236952 : java.policy fix for 4215035 assumed java.ext.dirs expansion was correct
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-05-10
  • Updated: 1999-05-26
  • Resolved: 1999-05-26
Related Reports
Duplicate :  
Description
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)

Comments
EVALUATION I am backing out the fix for 4215035 and this bug will be unnecessary. I will copy the description around to the original bug.
11-06-2004