[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
exec/read -s bug?
From: |
Lars Schneider |
Subject: |
exec/read -s bug? |
Date: |
Sun, 19 Aug 2018 18:33:49 +0200 |
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>
- exec/read -s bug?,
Lars Schneider <=