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

ORB.init() throws SecurityException when custom SecurityManager is installed.

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description



      Name: aaR10142 Date: 04/16/2001



      The CORBA.ORB.init(String args[], Properties props) method throws
      SecurityException when custom SecurityManager is installed.

      This problem appears during JCK test runs.
      The JCK test monitor setup own SecurityManager that deny properties access
      (and some other permissions), to prevent corrupting java environment by tests.

      Thus all tests that use ORB.init() methods fail with SecurityException in jdk1.4.
      They works correctly under jdk1.3, so this is regression
         
      See minimized test
      ---------- Tests.java ----------------
      import org.omg.CORBA.ORB;
      import java.applet.Applet;

      public class Test extends Applet{
                                                                     
          public static void main(String argv[]) {
             (new Test()).init();
          }
          
          public void init() {
              SecurityManager sm = new SecurityManager() {
                   public void checkPropertiesAccess() {
                        throw new SecurityException("Forbiden");
                   }
              };
              System.setSecurityManager(sm);
              ORB c = ORB.init(new String[0], null);
              System.out.println("Ok");
          }
      }
      ------------- JDK1.4 output-------------------------
      Exception in thread "main" java.lang.SecurityException: Forbiden
              at Test$1.checkPropertiesAccess(Test.java:8)
              at java.lang.System.getProperties(System.java:498)
              at com.sun.corba.se.internal.corba.ORB$4.run(ORB.java:670)
              at java.security.AccessController.doPrivileged(Native Method)
              at com.sun.corba.se.internal.corba.ORB.getSystemPropertyNames(ORB.java:666)
              at com.sun.corba.se.internal.corba.ORB.findORBPropertiesFromSystem(ORB.java:786)
              at com.sun.corba.se.internal.corba.ORB.set_parameters(ORB.java:437)
              at com.sun.corba.se.internal.POA.POAORB.set_parameters(POAORB.java:151)
              at com.sun.corba.se.internal.Interceptors.PIORB.set_parameters(PIORB.java:327)
              at org.omg.CORBA.ORB.init(ORB.java:351)
              at Test.main(Test.java:12)

      ------------- JDK1.3 output-------------------------
      Ok


      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            sbauersunw Stefan Bauer (Inactive)
            Reporter:
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: