public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFC: Untested Win32 InetAddress tweak
@ 2006-09-04 14:15 Gary Benson
  2006-09-06 16:58 ` Tom Tromey
  2006-10-01 17:36 ` Marco Trudel
  0 siblings, 2 replies; 15+ messages in thread
From: Gary Benson @ 2006-09-04 14:15 UTC (permalink / raw)
  To: java-patches

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

Hi all,

The last part of java.net.InetAddress.lookup (a native method) is the
same in both Posix and Win32 variants except for a security check that
was removed from the Posix variant in August 2004.  The attached patch
removes this check from the Win32, synchronising the two.

I don't have the ability to test this, so could someone try it for me?
Alternatively, is this a trivial enough change to just commit blind?

Cheers,
Gary

[-- Attachment #2: win32-no-security-check.patch --]
[-- Type: text/plain, Size: 1779 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 116678)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2006-09-04  Gary Benson  <gbenson@redhat.com>
+
+	* java/net/natInetAddressWin32.cc (lookup): Remove security
+	check.
+	* java/net/InetAddress.java (checkConnect): Removed.
+
 2006-09-01  Geoffrey Keating  <geoffk@apple.com>
 
 	* testsuite/libjava.jni/jni.exp (gcj_jni_invocation_test_one):
Index: java/net/natInetAddressWin32.cc
===================================================================
--- java/net/natInetAddressWin32.cc	(revision 116678)
+++ java/net/natInetAddressWin32.cc	(working copy)
@@ -94,13 +94,6 @@
     {
       if (!all)
         host = JvNewStringUTF (hptr->h_name);
-      java::lang::SecurityException *ex = checkConnect (host);
-      if (ex != NULL)
-        {
-          if (iaddr == NULL || iaddr->addr == NULL)
-            throw ex;
-          hptr = NULL;
-        }
     }
   if (hptr == NULL)
     {
Index: java/net/InetAddress.java
===================================================================
--- java/net/InetAddress.java	(revision 116678)
+++ java/net/InetAddress.java	(working copy)
@@ -352,25 +352,6 @@
     return new InetAddress [count];
   }
 
-  /* Helper function due to a CNI limitation.  */
-  private static SecurityException checkConnect (String hostname)
-  {
-    SecurityManager s = System.getSecurityManager();
-    
-    if (s == null)
-      return null;
-    
-    try
-      {
-	s.checkConnect (hostname, -1);
-	return null;
-      }
-    catch (SecurityException ex)
-      {
-	return ex;
-      }
-  }
-
   /**
    * Returns the IP address of this object as a String.  The address is in
    * the dotted octet notation, for example, "127.0.0.1".

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-10-04  8:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-04 14:15 RFC: Untested Win32 InetAddress tweak Gary Benson
2006-09-06 16:58 ` Tom Tromey
2006-09-07  7:36   ` Gary Benson
2006-10-01 17:36 ` Marco Trudel
2006-10-01 18:00   ` Mohan Embar
2006-10-02  7:19     ` Marco Trudel
2006-10-02 10:55       ` FYI: Win32 InetAddress fix Gary Benson
2006-10-02 11:22         ` Marco Trudel
2006-10-02 17:43           ` Tom Tromey
2006-10-03 10:35         ` FYI: Win32 InetAddress fix (really) Gary Benson
2006-10-03 15:10           ` David Daney
2006-10-03 16:55             ` Andrew Haley
2006-10-03 17:23               ` David Daney
2006-10-04  8:37                 ` Gary Benson
2006-10-03 15:30           ` Marco Trudel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).