Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14509

Re: exec/read -s bug?

From Lars Schneider <larsxschneider@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: exec/read -s bug?
Date 2018-08-19 20:45 +0200
Message-ID <mailman.5297.1534704344.1292.bug-bash@gnu.org> (permalink)
References <70D019FA-3393-404C-B689-20E499BC66B9@gmail.com>

Show all headers | View raw


> On Aug 19, 2018, at 6:33 PM, Lars Schneider <larsxschneider@gmail.com> wrote:
> 
> Hi,
> 
> consider this script:
> 
> 	#!/bin/bash
> 	[ "`whoami`" = "root" ] || {
> 	  exec sudo -u root "$0" "$@"
> 	}
> 	read -s -p "enter stuff: " stuff
> 
> If I run the script as normal user (not root!) and I abort the "read -s -p"
> call with "ctrl-c", then my shell is still in silent mode.
> 
> I can consitently replicate that behavior on Ubuntu 14.04.5 LTS (Trusty) 
> and BASH 4.3.11(1)-release (x86_64-pc-linux-gnu) as well as BASH 4.3.30.
> 
> I also installed BASH 4.4.18 from source and I can replicate the issue.

I did a mistake: The problem _was_ fixed with BASH 4.4.18.
Further testing revealed that it is fixed with 4.4. too but not in Bash-4.3 patch 46.

I think the following item in the release notes corresponds to the problem:

 oo. Fixed a bug that caused bash to not clean up readline's state, including
     the terminal settings, if it received a fatal signal while in a readline()
     call (including `read -e' and `read -s').

Does anyone see a workaround to set the readline state properly
for older BASH versions?

Thanks,
Lars

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: exec/read -s bug? Lars Schneider <larsxschneider@gmail.com> - 2018-08-19 20:45 +0200

csiph-web