Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 200209
Collapse All | Expand All

(-)src/org/eclipse/hyades/security/internal/util/BaseConnectUtil.java (-6 / +7 lines)
Lines 731-749 Link Here
731
731
732
	public static boolean isLocalHost(String hostname) {
732
	public static boolean isLocalHost(String hostname) {
733
		String name = "localhost";
733
		String name = "localhost";
734
		if (name.equals(hostname))
734
		if (name.equalsIgnoreCase(hostname))
735
			return true;
735
			return true;
736
736
737
		try {
737
		try {
738
			Node fnode = NodeFactory.createNode(name);
738
			InetAddress a1 = InetAddress.getByName(hostname);
739
			name = fnode.getInetAddress().getHostName();
739
			InetAddress a2 = InetAddress.getLocalHost();
740
			
741
			if(a1.getHostAddress().equals(a2.getHostAddress())){
742
				return true;
743
			}
740
		} catch (UnknownHostException exc) {
744
		} catch (UnknownHostException exc) {
741
			return false;
745
			return false;
742
		}
746
		}
743
747
744
		if (hostname.equals(name))
745
			return true;
746
747
		return false;
748
		return false;
748
	}
749
	}
749
750

Return to bug 200209