[508] in Zephyr_Bugs
here's a bug with the code for zctl.
daemon@ATHENA.MIT.EDU (Scott Dawson)
Wed Sep 22 22:10:18 1993
To: zephyr-bugs@MIT.EDU
Cc: sdawson@engin.umich.edu
Date: Wed, 22 Sep 1993 22:10:10 -0400
From: Scott Dawson <sdawson@engin.umich.edu>
This is in the snapshot code from athena-dist.mit.edu I got the code awhile
ago, but I don't think it gets updated often (if ever), so you probably have
the same problem but don't notice it.
in zctl.c:
char subsname[BUFSIZ];
char ourhost[MAXHOSTNAMELEN],ourhostcanon[MAXHOSTNAMELEN];
...
if (gethostname(ourhost,BUFSIZ) == -1) {
com_err(argv[0],errno,"while getting host name");
exit (1);
}
should be:
if (gethostname(ourhost,MAXHOSTNAMELEN) == -1) {
com_err(argv[0],errno,"while getting host name");
exit (1);
}
This normally probably wouldn't be a problem. I found out however,
that on hpux machines (hp700, 9.01), gethostname nulls out the rest
of the buffer that you give it. I think most gethostnames just null
terminate. This causes some problems on hps.
-Scott