lee@unmvax.UUCP (09/28/84)
Subject: tftp will go into an infinite loop if given the EOF character
Index: /usr/ucb/tftp 4.2BSD (fix)
Description:
See subject line
Repeat-By:
Get into tftp
Type ^D or whatever your EOF character is.
Watch the fun!
Fix:
Make the following changes to .../src/ucb/tftp/main.c
RCS file: RCS/main.c,v
retrieving revision 1.1
diff -c -r1.1 main.c
*** /tmp/,RCSt1013708 Thu Sep 27 16:58:43 1984
--- main.c Thu Sep 27 16:58:08 1984
***************
*** 457,463
putchar('\n');
for (;;) {
printf("%s> ", prompt);
! if (gets(line) == 0)
continue;
if (line[0] == 0)
continue;
--- 457,465 -----
putchar('\n');
for (;;) {
printf("%s> ", prompt);
! if (gets(line) == 0) {
! clearerr(stdin);
! putchar('\n');
continue;
}
if (line[0] == 0)
***************
*** 459,464
printf("%s> ", prompt);
if (gets(line) == 0)
continue;
if (line[0] == 0)
continue;
makeargv();
--- 461,467 -----
clearerr(stdin);
putchar('\n');
continue;
+ }
if (line[0] == 0)
continue;
makeargv();
--
--Lee (Ward)
{ucbvax,convex,gatech,pur-ee}!unmvax!lee
chris@umcp-cs.UUCP (Chris Torek) (09/28/84)
Wow, now tftp will endless loop at the end of a script just like ftp and telnet! (Just for grins, try the following: % telnet << eof eof Whee!) -- (This page accidently left blank.) In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland
lee@unmvax.UUCP (10/01/84)
> Wow, now tftp will endless loop at the end of a script just like ftp and > telnet! > > (Just for grins, try the following: > > % telnet << eof > eof > > Whee!) > -- > (This page accidently left blank.) > > In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 > UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris > CSNet: chris@umcp-cs ARPA: chris@maryland Wow, are you brain damaged or what? Try ending your script to ftp or tftp with "quit" I get no infinite loop... For telnet, have fun! -- --Lee (Ward) {ucbvax,convex,gatech,pur-ee}!unmvax!lee