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


Groups > gnu.bash.bug > #14508 > unrolled thread

exec/read -s bug?

Started byLars Schneider <larsxschneider@gmail.com>
First post2018-08-19 18:33 +0200
Last post2018-08-19 18:33 +0200
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

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

#14508 — exec/read -s bug?

FromLars Schneider <larsxschneider@gmail.com>
Date2018-08-19 18:33 +0200
Subjectexec/read -s bug?
Message-ID<mailman.5295.1534699754.1292.bug-bash@gnu.org>
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>

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web