SCCS-vsn: libexec/ftpd/ftpd.c 5.3
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)ftpd.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)ftpd.c 5.3 (Berkeley) %G%";
- char mark, *cp;
- int aflag = 0, count = 0, iacflag = 0, c;
+ int aflag = 0, count = 0, iacflag = 0, atmark;
+ char c, *cp;
if (!transflag) {
for (;;) {
if (!transflag) {
for (;;) {
- if (ioctl(fileno(stdin), SIOCATMARK, &mark) < 0) {
+ if (ioctl(fileno(stdin), SIOCATMARK, &atmark) < 0) {
perror("ioctl");
break;
}
perror("ioctl");
break;
}
- }
- read(fileno(stdin), &mark, 1);
- c = 0377 & mark;
+ read(fileno(stdin), &c, 1);
- recv(fileno(stdin), &mark, 1, MSG_OOB);
- c = 0377 & mark;
- read(fileno(stdin), &mark, 1);
+ recv(fileno(stdin), &c, 1, MSG_OOB);
+ read(fileno(stdin), &c, 1);
- if (ioctl(fileno(stdin), SIOCATMARK, &mark) < 0) {
+ if (ioctl(fileno(stdin), SIOCATMARK, &atmark) < 0) {
perror("ioctl");
break;
}
perror("ioctl");
break;
}
- }
- read(fileno(stdin), &mark, 1);
- c = 0377 & mark;
- if (c == IAC) {
+ read(fileno(stdin), &c, 1);
+ if (c == IAC || c == IP)
- }
- else if (c == IP) {
- aflag++;
- }
- recv(fileno(stdin), &mark, 1, MSG_OOB);
- c = 0377 & mark;
- if (c == IAC) {
+ recv(fileno(stdin), &c, 1, MSG_OOB);
+ if (c == IAC)
- }
- read(fileno(stdin), &mark, 1);
- c = 0377 & mark;
- if (c == DM) {
+ read(fileno(stdin), &c, 1);
+ if (c == DM)
cp = tmpline;
(void) getline(cp, 7, stdin);
upper(cp);
cp = tmpline;
(void) getline(cp, 7, stdin);
upper(cp);
- if (strcmp(cp, "ABOR\r\n")) {
+ if (strcmp(cp, "ABOR\r\n"))
tmpline[0] = '\0';
reply(426,"Transfer aborted. Data connection closed.");
reply(226,"Abort successful");
tmpline[0] = '\0';
reply(426,"Transfer aborted. Data connection closed.");
reply(226,"Abort successful");