Path: utzoo!mnetor!uunet!unisoft!mtxinu!rtech!news From: news@rtech.UUCP (USENET News System) Newsgroups: comp.bugs.4bsd Subject: rexec/rexecd bug + fix Message-ID: <2060@rtech.UUCP> Date: 6 May 88 15:47:42 GMT Reply-To: daveb@rtech.UUCP ("It takes a clear mind to make it") Organization: Relational Technology, Inc. Alameda, CA Lines: 45 Summary: short vs. ushort causes wraparound problem Index: Most 4BSD derivatives lib/libc/net/rexec.c etc/rexecd.c 4.3BSD Fix Description: rexec(3) incorrectly uses a short to hold a u_short port number. When the machine has been running long enough, this causes a wraparound error, and connection attempts fail. *** rexecd.c Fri Apr 29 10:43:47 1988 --- rexecd.c.new Fri Apr 29 10:48:01 1988 *************** *** 76,78 int s; ! short port; int pv[2], pid, ready, readfrom, cc; --- 76,78 ----- int s; ! u_short port; int pv[2], pid, ready, readfrom, cc; *** rexec.c Fri Apr 29 10:43:28 1988 --- rexec.c.new Fri Apr 29 10:47:16 1988 *************** *** 33,35 char c; ! short port; struct hostent *hp; --- 33,35 ----- char c; ! u_short port; struct hostent *hp; *************** *** 83,85 port = ntohs((u_short)sin2.sin_port); ! (void) sprintf(num, "%d", port); (void) write(s, num, strlen(num)+1); --- 83,85 ----- port = ntohs((u_short)sin2.sin_port); ! (void) sprintf(num, "%u", port); (void) write(s, num, strlen(num)+1); From: daveb@llama.rtech.UUCP ("It takes a clear mind to make it") Path: llama!daveb {amdahl, cpsc6a, mtxinu, ptsfa, sun, hoptoad}!rtech!daveb daveb@rtech.uucp