This is the mail archive of the mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

rcmd in glibc 2.1.90


When I try with glibc 2.1.90
rlogin foobar
I get

rcmd: getaddrinfo: Name or service not known

error message printed on the screen.
IMHO glibc 2.1.x error message was much better:

foobar: Unknown host

This patch changes this, alternatively we could just kill the rcmd:
getaddrinfo: and replace it with %s: (*ahost).

Also, I've noticed that if the local domain is not specified in search in
/etc/resolv.conf, then getaddrinfo does not resolve dotless names while it
did in glibc 2.1.
Say I'm on
my /etc/resolv.conf does not contain any search line.
With glibc 2.1
rlogin bar
works (provided exists), while with 2.2 it fails.
Is that desired behaviour or just a bug?

2000-05-17  Jakub Jelinek  <>

	* inet/rcmd.c (rcmd_af): If *ahost cannot be resolved, include
	unresolved hostname in the message.

--- libc/inet/rcmd.c.jj	Tue May  9 13:47:33 2000
+++ libc/inet/rcmd.c	Wed May 17 12:35:11 2000
@@ -134,9 +134,12 @@ rcmd_af(ahost, rport, locuser, remuser, 
 	(void)snprintf(num, sizeof(num), "%d", ntohs(rport));
 	error = getaddrinfo(*ahost, num, &hints, &res);
 	if (error) {
-	    fprintf(stderr, "rcmd: getaddrinfo: %s\n",
-		    gai_strerror(error));
-                return (-1);
+	    if (error == EAI_NONAME && *ahost != NULL)
+	        fprintf(stderr, "%s: Unknown host\n", *ahost);
+	    else
+		fprintf(stderr, "rcmd: getaddrinfo: %s\n",
+			gai_strerror(error));
+	    return (-1);
 	pfd[0].events = POLLIN;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]