Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 1996 10:46:44 +0100 (MET)
From:      Mikko Tyolajarvi <mikko@dynas.se>
To:        bugs@FreeBSD.org
Subject:   iijppp (2.1-RELEASE). Chatscript buglet.
Message-ID:  <Pine.SOL.3.91.960131104249.17796A-100000@spirit.dynas.se>

index | next in thread | raw e-mail


In case anyone is interested,

I stumbled into this cute bug in user ppp (from the 2.1-RELEASE CD).  It
causes chatscripts to fail to to match any string that is immediately
preceeded by a leading substring of itself.

I.e. when expecting "FooBar", "FooFooBar" will pass by unnoticed, or (how I
found out), it is not possible to wait for a "Password:" prompt using the
string "sword:"...


Here is one way to fix it:

*** chat.c.org  Fri Jan 19 13:06:00 1996
--- chat.c      Fri Jan 19 13:06:53 1996
***************
*** 266,272 ****
            return(MATCH);
          }
          } else {
!         s = str;
          if (inp == inbuff+ IBSIZE) {
            bcopy(inp - 100, inbuff, 100);
            inp = inbuff + 100;
--- 266,272 ----
            return(MATCH);
          }
          } else {
!         s = (ch == *str) ? str+1 : str;
          if (inp == inbuff+ IBSIZE) {
            bcopy(inp - 100, inbuff, 100);
            inp = inbuff + 100;


BTW: The chat program doesn't have this problem.

		Regards,
		/Mikko


 Mikko Työläjärvi (mikko@dynas.se)              <Insert cheesy quote here>
 DynaSoft, Dynamic Software AB




help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.91.960131104249.17796A-100000>