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

registry access check should succeed if call is from any known local host name

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: unknown, 1.1.2, 1.1.3, 1.1.5, 1.1.6
    • Fix Version/s: 1.2.0
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      1.2beta3
    • CPU:
      generic, sparc
    • OS:
      solaris_2.5.1, solaris_2.6, solaris_9
    • Verification:
      Not verified

      Description

      If a host has a network interface configured with multiple logical interfaces, Naming.rebind() fails. For example, I have a host phys-hoho with IP address 192.9.76.8 on controller le2. When I configure two additional logical interfaces on the same controller using ifconfig(1), Naming.rebind() fails. I set the logical interfaces to be le2:1, le2:2 and le2:3 with IP addresses 192.9.76.123, 192.9.76.124 and 192.9.76.125 and configure them up.

      I get following error from my program:
      Test.main - url is //phys-hoho/Test
      Test.main - Server RemoteException; nested exception is:
              java.rmi.AccessException: Registry.rebind 192.9.76.125/192.9.76.125 != phys-hoho/192.9.76.8
      java.rmi.ServerException: Server RemoteException; nested exception is:
              java.rmi.AccessException: Registry.rebind 192.9.76.125/192.9.76.125 != phys-hoho/192.9.76.8


      My code follows:

      ---------------------- TestI.java ------------------------------
      import java.rmi.*;
      import java.rmi.server.*;
      import java.util.*;
      import java.lang.*;
      import java.net.*;

      public interface TestI extends java.rmi.Remote {
              public void aMethod() throws java.rmi.RemoteException;
      }


      ------------------ Test.java ------------------------------------
      import java.rmi.*;
      import java.rmi.server.*;
      import java.util.*;
      import java.lang.*;
      import java.net.*;

      public class Test
          extends java.rmi.server.UnicastRemoteObject
          implements TestI, java.io.Serializable
      {
          public Test()
              throws java.rmi.RemoteException {
          }

          public synchronized void aMethod() {
          }

          public static void main(String args[]) {
              System.setSecurityManager(new RMISecurityManager());
              try {
                  Test test = new Test();

                  InetAddress addr = InetAddress.getLocalHost();
                  String url = new String("//" + addr.getHostName() +
                                      "/Test");
                  System.out.println("Test.main - url is " + url);
                  Naming.rebind(url, test);
              } catch (java.net.UnknownHostException ex) {
                  System.out.println ("Test.main - Host unknown");
                  ex.printStackTrace();
              } catch (java.net.MalformedURLException ex) {
                  System.out.println("Test.main - " + ex.getMessage());
                  ex.printStackTrace();
              } catch (java.rmi.UnknownHostException ex) {
                  System.out.println("Test.main - " + ex.getMessage());
                  ex.printStackTrace();
              } catch (java.rmi.RemoteException ex) {
                  System.out.println("Test.main - " + ex.getMessage());
                  ex.printStackTrace();
              }
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peterjones Peter Jones
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: