public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: Socket and ServerSocket throwpoint check tweaks
@ 2006-11-10 11:30 Gary Benson
  0 siblings, 0 replies; only message in thread
From: Gary Benson @ 2006-11-10 11:30 UTC (permalink / raw)
  To: mauve-patches

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

Hi all,

This commit fixes a couple of minor things in the throwpoint checks
for Socket and ServerSocket.

Cheers,
Gary

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2847 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/mauve/mauve/ChangeLog,v
retrieving revision 1.1986
diff -u -r1.1986 ChangeLog
--- ChangeLog	9 Nov 2006 19:15:39 -0000	1.1986
+++ ChangeLog	10 Nov 2006 11:28:02 -0000
@@ -1,3 +1,12 @@
+2006-11-10  Gary Benson  <gbenson@redhat.com>
+
+	* gnu/testlet/java/net/ServerSocket/security.java:
+	Always use localhost regardless of the actual hostname
+	of the address being listened on.
+
+	* gnu/testlet/java/net/Socket/security.java:
+	Removed an unused import.
+
 2006-11-09  Tania Bento  <tbento@redhat.com>
 
 	* gnu/testlet/javax/swing/JLabel/constructor.java: Added new tests.
Index: gnu/testlet/java/net/ServerSocket/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/net/ServerSocket/security.java,v
retrieving revision 1.1
diff -u -r1.1 security.java
--- gnu/testlet/java/net/ServerSocket/security.java	9 Oct 2006 14:55:17 -0000	1.1
+++ gnu/testlet/java/net/ServerSocket/security.java	10 Nov 2006 11:28:02 -0000
@@ -20,8 +20,8 @@
 
 package gnu.testlet.java.net.ServerSocket;
 
-import java.net.InetAddress;
 import java.net.BindException;
+import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketPermission;
@@ -39,9 +39,7 @@
       harness.checkPoint("setup");
 
       InetAddress inetaddr = InetAddress.getByName(null);
-      String hostname = inetaddr.getHostName();
       String hostaddr = inetaddr.getHostAddress();
-      harness.check(!hostname.equals(hostaddr));
 
       ServerSocket ssocket = new ServerSocket(0, 50, inetaddr);
       int sport = ssocket.getLocalPort();
@@ -49,10 +47,10 @@
       int cport = csocket.getLocalPort();
       
       Permission[] checkListen80 = new Permission[] {
- 	new SocketPermission(hostname + ":80", "listen")};
+ 	new SocketPermission("localhost:80", "listen")};
 
       Permission[] checkListen1024plus = new Permission[] {
- 	new SocketPermission(hostname + ":1024-", "listen")};
+ 	new SocketPermission("localhost:1024-", "listen")};
 
       Permission[] checkAccept = new Permission[] {
  	new SocketPermission(hostaddr + ":" + cport, "accept")};
Index: gnu/testlet/java/net/Socket/security.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/net/Socket/security.java,v
retrieving revision 1.1
diff -u -r1.1 security.java
--- gnu/testlet/java/net/Socket/security.java	5 Oct 2006 14:44:55 -0000	1.1
+++ gnu/testlet/java/net/Socket/security.java	10 Nov 2006 11:28:02 -0000
@@ -27,7 +27,6 @@
 import java.net.SocketException;
 import java.net.SocketPermission;
 import java.security.Permission;
-import java.util.PropertyPermission;
 
 import gnu.testlet.Testlet;
 import gnu.testlet.TestHarness;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-10 11:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-10 11:30 FYI: Socket and ServerSocket throwpoint check tweaks Gary Benson

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).