JDK-6180108 : SocketPermission("127.0.0.1:3000",...) does not imply SocketPermission("localhost:3000",...)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-10-15
  • Updated: 2011-03-17
  • Resolved: 2004-11-24
Related Reports
Duplicate :  
Relates :  
Description
On Solaris and SuSE Linux with kernal 2.4.21-99-default, the following program
prints "true":

import java.net.SocketPermission;
import java.security.Permission;

public class LocalHostImplies {
    public static void main(String[] args) throws Exception {
	Permission p1 = new SocketPermission("127.0.0.1:3000", "listen");
	Permission p2 = new SocketPermission("localhost:3000", "listen");
	System.out.println(p1.implies(p2));
    }
}

However, on SuSE linux with kernal 2.6.5-7.108-default, the above program
prints "false".

This behavior might affect applications that install customized security
managers.

More information is available in CR 6178018.
###@###.### 10/15/04 22:04 GMT

Comments
EVALUATION The is the same bug as 5087907, which has been fixed in mustang, 1.5.0_01 and 1.4.2_07. Closing this as a dup. ###@###.### 2004-11-24 14:47:00 GMT
24-11-2004