RFC: Untested Win32 InetAddress tweak
Marco Trudel
mtrudel@gmx.ch
Sun Oct 1 17:36:00 GMT 2006
Hello Gary
Gary Benson wrote:
> 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?
Something must have went wrong. java/net/InetAddress.java was changed
according this patch, java/net/natInetAddressWin32.cc has not. This
leads to an error on compilation. Please commit the rest as well...
Here's the link to the trunk head, you can see that the code is still there:
http://gcc.gnu.org/viewcvs/trunk/libjava/java/net/natInetAddressWin32.cc?view=markup
Marco
> Cheers,
> Gary
>
>
> ------------------------------------------------------------------------
>
> 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".
More information about the Java-patches
mailing list