Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8261087

closed/com/sun/jndi/rmi/factoriesfilter/RmiObjectsFactoryTest needs additional access permission in policy.file on Solaris

XMLWordPrintable

      Test closed/com/sun/jndi/rmi/factoriesfilter/RmiObjectsFactoryTest fails on Solaris 11 SPARCv9 due to missing permission in policy file. The issue occurs when the test runs with following runtime parameters.

      @run main/othervm/policy=policy.file -Djava.security.manager -Djava.security.properties=${test.src}/disallowFactory.props RmiObjectsFactoryTest false

      @run main/othervm/policy=policy.file -Djava.security.manager -Djava.security.properties=${test.src}/disallowFactory.props -Djdk.jndi.object.factoriesFilter=com.test.MyFactory RmiObjectsFactoryTest true

      Testsuite name: j2se_rest
      Test name(s):
      closed/com/sun/jndi/rmi/factoriesfilter/RmiObjectsFactoryTest.java

      Product(s) tested: JDK 7u301 b03
      OS/architecture: Solaris 11 SPARCv9

      Reproducible: Always

      Is it a Regression: No, It's a newly added test

      Is it a platform-specific issue: Yes

      Exception/Error from log:
      java.lang.ExceptionInInitializerError
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:224)
      at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
      at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
      at sun.security.jca.ProviderList.getProvider(ProviderList.java:232)
      at sun.security.jca.ProviderList$3.get(ProviderList.java:147)
      at sun.security.jca.ProviderList$3.get(ProviderList.java:142)
      at java.util.AbstractList$Itr.next(AbstractList.java:358)
      at java.security.SecureRandom.getPrngAlgorithm(SecureRandom.java:556)
      at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:193)
      at java.security.SecureRandom.<init>(SecureRandom.java:161)
      at java.rmi.server.UID.<init>(UID.java:112)
      at java.rmi.server.ObjID.<clinit>(ObjID.java:88)
      at sun.rmi.registry.RegistryImpl.<clinit>(RegistryImpl.java:90)
      at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
      at TestLibrary.createRegistryOnEphemeralPort(TestLibrary.java:392)
      at RmiObjectsFactoryTest.main(RmiObjectsFactoryTest.java:71)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.util")
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:395)
      at java.security.AccessController.checkPermission(AccessController.java:559)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
      at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1525)
      at java.lang.ClassLoader$1.run(ClassLoader.java:503)
      at java.lang.ClassLoader$1.run(ClassLoader.java:501)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:501)
      at sun.security.pkcs11.SunPKCS11.<clinit>(SunPKCS11.java:63)
      ... 28 more

      PFA the full logs.

      Analysis done:
      The test scenario involves the runtime access to package "sun.security.util" but the same was denied as policy.file misses the same. Test passed after adding the following line in policy.file

      permission java.lang.RuntimePermission "accessClassInPackage.sun.security.util";

      But this issue is not seen with JDK 8.

            dbuck David Buck
            ddamodaran Deepak Damodaran
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: