harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2910) [classlib][security] Harmony cannot identify 'codeBase' feature in policy file
Date Tue, 19 Jun 2007 19:38:26 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506272
] 

Vasily Zakharov commented on HARMONY-2910:
------------------------------------------

I've also investigated the tests.api.java.security.PermissionCollectionTest.test_impliesLjava_security_Permission()
 failure.

With the latest patch applied, the test actually passes on DRL VM.

On IBM VM the test fails because the child JVM it starts with exec crashes with the following
StackOverflowError:

java.lang.StackOverflowError
	at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:475)
	at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:345)
	at java.nio.charset.Charset.encode(Charset.java:686)
	at java.lang.String.getBytes(String.java:825)
	at org.apache.harmony.luni.util.Util.getBytes(Util.java:56)
	at java.io.File.properPath(File.java:1182)
	at java.io.File.getAbsolutePath(File.java:454)
	at java.io.File.getAbsoluteFile(File.java:466)
	at org.apache.harmony.security.fortress.PolicyUtils.normalizeURL(PolicyUtils.java:297)
	at org.apache.harmony.security.PolicyEntry.impliesCodeSource(PolicyEntry.java:82)
	at org.apache.harmony.security.fortress.DefaultPolicy.getPermissions(DefaultPolicy.java:215)
	at java.security.Policy.implies(Policy.java:14)
	at java.security.ProtectionDomain.implies(ProtectionDomain.java:160)
	at java.security.AccessController.checkPermission(AccessController.java:92)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:746)
	at java.lang.SecurityManager.checkRead(SecurityManager.java:398)
	at java.io.File.isDirectory(File.java:711)
	at java.io.File.getAbsoluteName(File.java:135)
	at java.io.File.toURI(File.java:1262)
        ... (11 lines repeated many times)
	at org.apache.harmony.security.fortress.PolicyUtils.normalizeURL(PolicyUtils.java:297)
	at org.apache.harmony.security.PolicyEntry.impliesCodeSource(PolicyEntry.java:82)
	at org.apache.harmony.security.fortress.DefaultPolicy.getPermissions(DefaultPolicy.java:215)
	at java.security.Policy.implies(Policy.java:14)
	at java.security.ProtectionDomain.implies(ProtectionDomain.java:160)
	at java.security.AccessController.checkPermission(AccessController.java:92)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:746)
	at java.lang.SecurityManager.checkRead(SecurityManager.java:398)
	at java.io.File.isDirectory(File.java:711)
	at java.io.File.getAbsoluteName(File.java:135)
	at java.io.File.toURI(File.java:1262)
	at org.apache.harmony.security.fortress.PolicyUtils.normalizeURL(PolicyUtils.java:297)
	at org.apache.harmony.security.PolicyEntry.impliesCodeSource(PolicyEntry.java:82)
	at org.apache.harmony.security.fortress.DefaultPolicy.getPermissions(DefaultPolicy.java:215)
	at java.security.Policy.implies(Policy.java:14)
	at java.security.ProtectionDomain.implies(ProtectionDomain.java:160)
	at java.security.AccessController.checkPermission(AccessController.java:92)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:746)
	at java.lang.SecurityManager.checkRead(SecurityManager.java:398)
	at java.util.zip.ZipFile.<init>(ZipFile.java:88)
	at java.util.jar.JarFile.<init>(JarFile.java:172)
	at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.openJarFile(JarURLConnection.java:144)
	at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.findJarFile(JarURLConnection.java:121)
	at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:87)
	at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:14)
	at java.net.URLClassLoader.createURLJarHandler(URLClassLoader.java:141)
	at java.net.URLClassLoader.makeNewHandler(URLClassLoader.java:998)
	at java.net.URLClassLoader.getHandler(URLClassLoader.java:981)
	at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1190)
	at java.net.URLClassLoader$4.run(URLClassLoader.java:889)
	at java.net.URLClassLoader$4.run(URLClassLoader.java:1)
	at java.security.AccessController.doPrivileged(AccessController.java:21)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:886)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:632)
	at java.net.URLClassLoader$SubURLClassLoader.loadClass(URLClassLoader.java:18)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:594)
	at java.lang.Class.forNameImpl(Native Method)
	at java.lang.Class.forName(Class.java:162)
	at tests.support.Support_PermissionCollection.main(Support_PermissionCollection.java:38)


> [classlib][security] Harmony cannot identify 'codeBase' feature in policy file
> ------------------------------------------------------------------------------
>
>                 Key: HARMONY-2910
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2910
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ruth Cao
>            Assignee: Stepan Mishura
>         Attachments: Harmony-2910-2.zip, Harmony-2910.diff, Harmony-2910.diff, Harmony-2910.diff,
regressionTest2910.txt
>
>
> create a simple policy file and then run PolicyTest  with the argument and the policy
file[1] as following on Windows XP:
> -Dtest.bin.dir=c:\api\ -Djava.security.policy=<policy file path>
> public class PolicyTest {	
> 	public static void main(String[] args) throws Exception {
> 		Policy p = Policy.getPolicy();
> 		ProtectionDomain pd = new ProtectionDomain(new CodeSource(new URL(
> 				"file:/c:/api/*"), (java.security.cert.Certificate[]) null), null);
> 		PermissionCollection pCollection = p.getPermissions(pd);
> 		Enumeration<Permission> elements = pCollection.elements();
> 		while (elements.hasMoreElements()) {
> 			if(elements.nextElement().equals(new AllPermission())){
> 				System.out.println("contains AllPermission");
> 			}
> 		}
> 	}
> }
> RI prints:
> contains AllPermission
> while Harmony prints nothing.
> [1]
> grant codeBase "file:${test.bin.dir}/-" {
>    permission java.security.AllPermission; 
> }; 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message