[13626] in Athena Bugs
bug in write
daemon@ATHENA.MIT.EDU (cat@MIT.EDU)
Fri Jun 30 16:26:00 1995
From: cat@MIT.EDU
Date: Fri, 30 Jun 1995 16:25:46 -0400
To: rel-eng@MIT.EDU, mbarker@MIT.EDU, bugs@MIT.EDU
The current release version of write will die claiming a segmentation
fault when given an argument with something other than a hostname on
decmips machines. Here is an example of something that will break:
write cat@18.248.0.48
Changing the following parts of /afs/dev/source/src/athena/bin/write.c :
107d106
< static char *addrs[2];
117,120c116
<
< addrs[0] = (char *)&defaddr;
< addrs[1] = NULL;
< def.h_addr_list = addrs;
---
> def.h_addr = (char *)&defaddr;
244c240
< bcopy(hp->h_addr, (char *)&sin.sin_addr, sizeof(struct in_addr));
---
> bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
will prevent write from seg faulting when given and IP address instead
of a host name.
Here is a more complete list of what will break on what platforms:
On maze a DEC/DECSTATION-5000.25/ULTRIX:
maze %write cat@18.177.0.155
Segmentation fault
maze %write cat@
Segmentation fault
On packet-drop a sparc5 runing Solaris
Nothing known breaks on this platform.
On pickled herring a IBM/RS-6000/AIX
pickled-herring %write cat@
Segmentation fault
On opus a SGI/irix
opus %write cat
setpgrp 0: Error 0
setpgrp !0: Error 0
(but did procedd to work properly anyway)
opus %write cat@
Segmentation fault
I compiled the code, and tested it on all platforms (sun, rs6000, SGI,
dec) with the following tests:
# no machine name specified
maze %write cat
#machine name specified
maze %write cat@maze
#machine cname specified
write cat@darkness
#IP address specified
write cat@18.177.0.155
# nothing after "@"
write cat@
# Bad machine name spcified
write cat@ninja
# Bad Ip address specified
write cat@18.248.0.18
#truncated IP address
write cat@18.177.0
# user not logged in
write fido@maze
# machine with out a proper writed running, which will refuse the connection
write chanson@bloodwing.mac.cc.cmu.edu
It succeeded on all these tests. The problem on SGIs with it
printing:
setpgrp 0: Error 0
setpgrp !0: Error 0
was not fixed.