Subject: rlogind bug revisited...
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Christos Zoulas <christos@deshaw.com>
List: current-users
Date: 05/24/1994 21:01:12
If you did not understand the previous message, here's some code that
demonstrates the problem.

christos

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>


main(argc, argv)
	int argc;
	char *argv[];
{
	struct hostent *hp;
	hp = gethostbyname(argv[1]);
	if (hp == NULL) {
	    herror("gethostbyname 1");
	    return 1;
	}
	hp = gethostbyaddr((char*) &hp->h_addr[0], 4, AF_INET);
	if (hp == NULL) {
	    herror("gethostbyaddr");
	    return 1;
	}

	hp = gethostbyname(hp->h_name);
	if (hp == NULL) {
	    herror("gethostbyname 2");
	    return 1;
	}
	return 0;
}

------------------------------------------------------------------------------