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


Groups > gnu.bash.bug > #14508

exec/read -s bug?

From Lars Schneider <larsxschneider@gmail.com>
Newsgroups gnu.bash.bug
Subject exec/read -s bug?
Date 2018-08-19 18:33 +0200
Message-ID <mailman.5295.1534699754.1292.bug-bash@gnu.org> (permalink)

Show all headers | View raw


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.

Can you replicate the issue? 
Is this a known issue?
Do you consider it a bug? 
How would you investigate that further? 
Do you see a workaround for the problem?

I briefly looked into the `builtins/exec.def` and `builtins/read.def` code
and my impression is that `exec` might mess with the `ttsave/ttyrestore` 
stack.

Thanks,
Lars


PS: Before I reached out on the bug bash mailing list I asked for help here:
https://unix.stackexchange.com/questions/463253/why-would-read-s-behaves-differently-than-read-if-killed-with-ctrl-c <https://unix.stackexchange.com/questions/463253/why-would-read-s-behaves-differently-than-read-if-killed-with-ctrl-c>

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


Thread

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

csiph-web