Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 573936 - [PATCH] read in a ksh script in utf-8 locale does not restore tty settings
[PATCH] read in a ksh script in utf-8 locale does not restore tty settings
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh (Show other bugs)
5.4
All Linux
low Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
qe-baseos-tools
: EasyFix, Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-16 04:56 EDT by Tomas Smetana
Modified: 2018-10-27 09:58 EDT (History)
5 users (show)

See Also:
Fixed In Version: ksh-20100621-1.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 572291
: 577223 (view as bug list)
Environment:
Last Closed: 2012-02-21 00:49:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0159 normal SHIPPED_LIVE ksh bug fix and enhancement update 2012-02-20 09:53:47 EST

  None (edit)
Description Tomas Smetana 2010-03-16 04:56:43 EDT
+++ This bug was initially created as a clone of Bug #572291 +++

Created an attachment (id=399158)
cook tty if operating in a multibyte environment (utf-8)

Description of problem:
When a read command is run in a ksh script and is allowed to time out, ksh fails to restore the tty settings. Due to this the terminal stops echoing characters anymore until it is reset. This happens only when the locale is set to something with utf-8 encoding (en_US.UTF-8 for example)

Version-Release number of selected component (if applicable):
ksh-20100309-1.fc14.x86_64

How reproducible:
Always

Steps to Reproduce:
Run the following script and wait for it to return:

##############################
#!/bin/ksh
TMOUT=5
read
##############################

Actual results:
Script returns after 5 seconds and the terminal no longer echoes key strokes

Expected results:
Script returns after 5 seconds and the terminal behaves normally

Additional info:
When running in a UTF-8 locale, ksh employs viraw mode to accept input, due to which the tty is made into a raw terminal with echo disabled. It does not however, restore the terminal on exit, leading to a tty which does not echo keystrokes. Attached patch fixes this.
Comment 2 Michal Hlavinka 2010-03-16 05:30:17 EDT
I can reproduce this.

Changing test script to:
#!/bin/ksh
set -o emacs
TMOUT=5
read

workarounds this problem (set -o vi can be used also)

I've already reported this upstream and we're discussing this issue now
Comment 4 RHEL Product and Program Management 2010-08-09 14:20:40 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 6 RHEL Product and Program Management 2011-01-11 15:22:27 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 7 RHEL Product and Program Management 2011-01-11 17:42:40 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 8 RHEL Product and Program Management 2011-05-31 09:20:47 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 10 Miroslav Franc 2011-08-24 06:43:57 EDT
Another reproducer:

##############################
#!/bin/ksh -i
TMOUT=5
read
##############################

Supposedly fixed versions in Rawhide (bug 572291) and RHEL6 (bug 577223) are still broken for this.
Comment 12 errata-xmlrpc 2012-02-21 00:49:23 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0159.html

Note You need to log in before you can comment on or make changes to this bug.