[Patch] rexec check for sockaddr length

Thorsten Kukuk kukuk@suse.de
Sat Apr 7 07:53:00 GMT 2001


Hi,

I have a patch for the rexec() function. Through the changed size
of sockaddr_in6 between kernel 2.2 and 2.4 this check will always
fail with IPv6 on kernel 2.2. The second mistake is, that we use
perror to report an error if the length of the sockaddr struct is
not the one we expected. The error messages is in this case bogus 
and has nothing to do with the real problem.

So I suggest to remove the check:

2001-04-07  Thorsten Kukuk  <kukuk@suse.de>

	*  inet/rexec.c(rexec): Remove check for length of returned
	   sockaddr data.

--- inet/rexec.c	2000/10/28 00:28:37	1.17
+++ inet/rexec.c	2001/04/07 14:47:40
@@ -117,8 +117,7 @@
 		}
 		listen(s2, 1);
 		sa2len = sizeof (sa2);
-		if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0 ||
-		    sa2len != SA_LEN((struct sockaddr *)&sa2)) {
+		if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
 			perror("getsockname");
 			(void) __close(s2);
 			goto bad;

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/       kukuk@suse.de
SuSE GmbH            Schanzaeckerstr. 10            90443 Nuernberg
Linux is like a Vorlon.  It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.



More information about the Libc-hacker mailing list