Description of problem: chat has a lot of issues handling -E option and report/clear report/abort/clear abort statements. Version-Release number of selected component (if applicable): ppp-2.4.5-33.el7.x86_64 Steps to reproduce: I'm making an example for REPORT, the same applies to ABORT, CLR_REPORT and CLR_ABORT. 1. Create a file with this inside REPORT "$v1" "$v1" "" and call it chat.script 2. Run $ export v1=abc 3. Run chat w/o "-E", as expected $v1 doesn't get substituted: $ chat -vs -f chat.script >/dev/ttyS0 </dev/ttyS0 report ($v1) expect ($v1) 4. Run chat with -E, $v1 is expanded for the expect string but not for REPORT I think this is a bug. $ chat -E -vs -f chat.script >/dev/ttyS0 </dev/ttyS0 report ($v1) <====== BUG, $v1 not expanded expect (abc) <====== OK, $v1 expanded 5. Apply this quick and dirty patch --- ppp/chat/chat.c.orig 2005-11-26 19:30:31.000000000 +0100 +++ ppp/chat/chat.c 2005-11-26 19:30:46.000000000 +0100 @@ -1129,7 +1129,7 @@ report_string[n_reports++] = s1; if (verbose) - msgf("report (%v)", s); + msgf("report (%v)", s1); return; } 6. Re-run chat w/ -E $ chat -E -vs -f chat.script >/dev/ttyS0 </dev/ttyS0 report (abc) <==== SUCCESS expect (abc) ADDITIONAL INFORMATION: - chat.c uses "clean()" to clean the strings and expand variables. - for the 4 cases above, it cleans the string into a different variable - the it uses the original variable instead of the new one - also, all the 4 tests if (strlen(s1) > strlen(s) appear to be wrong, since it's normal for a string to increase in size due to variable expansion, ie: $ v1=abc (abc is long as $v1) $ chat -E -vs -f chat.script >/dev/ttyS0 </dev/ttyS0 report ($v1) expect (abc) ^CSIGINT $ v1=abcd (abcd is longer than $v1) $ chat -E -vs -f chat.script >/dev/ttyS0 </dev/ttyS0 Illegal or too-long REPORT string ('$v1') $
Thank you for taking the time to report this issue to us. We appreciate the feedback and use reports such as this one to guide our efforts at improving our products. That being said, this bug tracking system is not a mechanism for requesting support, and we are not able to guarantee the timeliness or suitability of a resolution. If this issue is critical or in any way time sensitive, please raise a ticket through the regular Red Hat support channels to ensure it receives the proper attention and prioritization to assure a timely resolution. For information on how to contact the Red Hat production support team, please visit: https://www.redhat.com/support/process/production/#howto
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.