rexec/rexecd bug + fix
USENET News System
news at rtech.UUCP
Sat May 7 01:47:42 AEST 1988
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 at llama.rtech.UUCP ("It takes a clear mind to make it")
Path: llama!daveb
{amdahl, cpsc6a, mtxinu, ptsfa, sun, hoptoad}!rtech!daveb daveb at rtech.uucp
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list