hanging telnet, rlogin, clear_tty and 4.0.1
Evan Schaffer
evan at ssyx.ucsc.edu
Sun Dec 25 06:51:08 AEST 1988
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);
}
More information about the Comp.sys.sun
mailing list