Subject: bin/9786: chat(8)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <swp@alumni.rice.edu>
List: netbsd-bugs
Date: 04/05/2000 00:34:09
>Number:         9786
>Category:       bin
>Synopsis:       Previous fix to chat(8) broke it.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 04 22:43:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Steve Peurifoy
>Release:        NetBSD-1.4V
>Organization:
>Environment:
System: NetBSD loop 1.4V NetBSD 1.4V (loop) #1: Fri Mar 24 18:33:34 MST 2000 root@loop:/usr/src/sys/arch/hp300/compile/loop hp300


>Description:
	Last May a change to chat.c was committed as a fix for PR 5685.
	The change was to set the ONLCR flag for the tty device chat(8)
	was interacting with.  The problem is that this rather ad-hoc
	kludge has the potential to break any chat script that expects
	to be able to precisely control its send strings by using the
	escape sequences as documented (and in fact did break at least
	one such script).  The previous version had output postprocessing
	turned off for a reason.
>How-To-Repeat:
	Run a chat script with a send string of "foo\r\n\c" and watch
	what comes out of the tty port.  In this case it's possible to
	compensate for what the tty driver inflicts on your string (once
	you find out about it) but if instead you actually wanted to
	send "foo\n\c" you'd be out of luck.
>Fix:
	I think this change should be reverted.

Index: chat.c
===================================================================
RCS file: /cvs/src/usr.sbin/pppd/chat/chat.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 chat.c
*** chat.c	1999/11/14 23:13:43	1.1.1.4
--- chat.c	2000/04/05 04:36:31
***************
*** 583,589 ****
      have_tty_parameters  = 1;
  
      t.c_iflag     |= IGNBRK | ISTRIP | IGNPAR;
!     t.c_oflag     |= OPOST | ONLCR;
      t.c_lflag      = 0;
      t.c_cc[VERASE] =
      t.c_cc[VKILL]  = 0;
--- 583,589 ----
      have_tty_parameters  = 1;
  
      t.c_iflag     |= IGNBRK | ISTRIP | IGNPAR;
!     t.c_oflag      = 0;
      t.c_lflag      = 0;
      t.c_cc[VERASE] =
      t.c_cc[VKILL]  = 0;

>Release-Note:
>Audit-Trail:
>Unformatted: