[5437] in Athena Bugs
ftpd
daemon@ATHENA.MIT.EDU (John Carr)
Fri Jul 6 03:46:38 1990
To: bugs@ATHENA.MIT.EDU
Date: Fri, 06 Jul 90 03:46:18 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
This patch fixes some compiler warnings/errors in ftpd:
1. "statement not reached"
2. missing cast in accept() call
3. more arguments passed to reply() than reply()
is prepared to handle
4. declaration of index() should come from include file
Not included is a patch needed to yyerror(): ftpd will dump core if it gets
a command not containing a newline (index(foo, '\n') is called, and its
return value not checked against NULL),
*** /source/bsd-4.3/common/etc/ftpd/ftpd.c Tue May 1 16:45:50 1990
--- ftpd.c Fri Jul 6 03:16:52 1990
***************
*** 156,160 ****
timeout = atoi(++cp);
goto nextopt;
- break;
default:
--- 156,159 ----
***************
*** 461,465 ****
int s, fromlen = sizeof(from);
! s = accept(pdata, &from, &fromlen);
if (s < 0) {
reply(425, "Can't open data connection.");
--- 460,464 ----
int s, fromlen = sizeof(from);
! s = accept(pdata, (struct sockaddr *)&from, &fromlen);
if (s < 0) {
reply(425, "Can't open data connection.");
***************
*** 640,644 ****
}
! reply(n, s, p0, p1, p2, p3, p4)
int n;
char *s;
--- 639,643 ----
}
! reply(n, s, p0, p1, p2, p3, p4, p5)
int n;
char *s;
***************
*** 646,650 ****
printf("%d ", n);
! printf(s, p0, p1, p2, p3, p4);
printf("\r\n");
(void) fflush(stdout);
--- 645,649 ----
printf("%d ", n);
! printf(s, p0, p1, p2, p3, p4, p5);
printf("\r\n");
(void) fflush(stdout);
***************
*** 651,659 ****
if (debug) {
syslog(LOG_DEBUG, "<--- %d ", n);
! syslog(LOG_DEBUG, s, p0, p1, p2, p3, p4);
}
}
! lreply(n, s, p0, p1, p2, p3, p4)
int n;
char *s;
--- 650,658 ----
if (debug) {
syslog(LOG_DEBUG, "<--- %d ", n);
! syslog(LOG_DEBUG, s, p0, p1, p2, p3, p4, p5);
}
}
! lreply(n, s, p0, p1, p2, p3, p4, p5)
int n;
char *s;
***************
*** 660,664 ****
{
printf("%d-", n);
! printf(s, p0, p1, p2, p3, p4);
printf("\r\n");
(void) fflush(stdout);
--- 659,663 ----
{
printf("%d-", n);
! printf(s, p0, p1, p2, p3, p4, p5);
printf("\r\n");
(void) fflush(stdout);
***************
*** 665,669 ****
if (debug) {
syslog(LOG_DEBUG, "<--- %d- ", n);
! syslog(LOG_DEBUG, s, p0, p1, p2, p3, p4);
}
}
--- 664,668 ----
if (debug) {
syslog(LOG_DEBUG, "<--- %d- ", n);
! syslog(LOG_DEBUG, s, p0, p1, p2, p3, p4, p5);
}
}
***************
*** 837,841 ****
char *shell;
int found = 0;
! char line[BUFSIZ], *index(), *getusershell();
if ((p = getpwnam(name)) == NULL)
--- 836,840 ----
char *shell;
int found = 0;
! char line[BUFSIZ], *getusershell();
if ((p = getpwnam(name)) == NULL)