🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #9892

hanging telnet, rlogin, clear_tty and 4.0.1

#9892
From: Evan Schaffer
Date: Sat, 24 Dec 1988 20:51
58 lines
2088 bytes
We have an open service call to sun, working on this set of related
problems:

1. telnet to the 4.0 host closes immediately
2. telnet to the 4.0 host prints login: but is in cbreak mode;
	name^J yields passwd, but once logged in any char
	acts like ^D and logs you out
3. a sunview window disappears when the first char is typed
4. rlogin to the 4.0 hosts closes immediately

I suspect the problem is related to a combination of 4.0 and the nts-100
terminal servers and cisco gateway which share the local net. but i am
still clue-less. 

We're watching packets with a pc and netwatch, and i am hypothesizing that
the nts-100's don't release their pty after inactivity. Courtes of Barbara
Wright, here is clearutmp.c which prints the utmp readably without
arguments, and flushes utmp of ALL bogus entries with any argument:

#include <sys/time.h>
#include <utmp.h>
#define UTMP_MODE 0666

main(cnt, arg)
int cnt;
char *arg[];
{
	struct utmp U;
	struct tm *localtime(), *T;
	int fd, fo;

	if (--cnt)
		fo = creat("/etc/utmp.tmp", UTMP_MODE);
	fd = open ("/etc/utmp", 0);

	while(read(fd, &U, sizeof(U))) {

		T = localtime(&U.ut_time);

		printf("%8.8s\t%8.8s\t%6.6s\t%d/%d/%d\t%02d:%02d:%02d\n",
			U.ut_line,U.ut_name,U.ut_host,
			T->tm_mon+1, T->tm_mday, T->tm_year,
			T->tm_hour, T->tm_min, T->tm_sec);
		if (cnt)
			if (U.ut_name[0])
				write(fo, &U, sizeof(U));
	}
	close(fd);

	if (cnt) {
		close(fo);
		unlink("/etc/utmp");
		link("/etc/utmp.tmp", "/etc/utmp");
		chmod("/etc/utmp", UTMP_MODE);
		unlink("/etc/utmp.tmp");
	}
	exit(0);
}
Technical Details
Message-ID: <8812161556.AA08573@ssyx.ucsc.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rutgers!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rutgers!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: evan@ssyx.ucsc.edu (Evan Schaffer)
Newsgroups: comp.sys.sun
Subject: hanging telnet, rlogin, clear_tty and 4.0.1
Message-ID: <8812161556.AA08573@ssyx.ucsc.edu>
Date: 24 Dec 88 20:51:08 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 58
Approved: Sun-Spots@rice.edu
Original-Date: Fri, 16 Dec 88 07:56:21 PST
X-Sun-Spots-Digest: Volume 7, Issue 75, message 4 of 11