Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Lars Schneider Newsgroups: gnu.bash.bug Subject: exec/read -s bug? Date: Sun, 19 Aug 2018 18:33:49 +0200 Lines: 43 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1534699755 31042 208.118.235.17 (19 Aug 2018 17:29:15 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=KBWISAo0KKp37OW34bT4MbgrC+DkNI4TbTjz03/ljYY=; b=A1HUjuL8Xcg5+9tjU7cu7nmsX2MAL4q8HEgPpQfAv5g/O4SyZglbDc01jyHYLkkOZF ghA9lbqgdxchB/xUByquJnVBglBR4t9ZxfmZHyWSi/L1o4zl665fgG2SGtTF08UeIX5C qL8EOAerH5Q5J7GdvN606LZ6NueSEHV3RuyrhbHK7FPqeHtIzyLjSL7grOf6dpOnSVwR n/S2ewY+3KtHGv9z3jXB1/y80RQ0065KStIUriOMnsMZQ5OyssFRL2Q+enhS/Yn5J52F 3LPR7AlH90bn0xZi5SLrQJDT7Y2n1qNypdLphrVT9YQ+CEV5kAbIzGtSUibMRoMM9prU w1JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=KBWISAo0KKp37OW34bT4MbgrC+DkNI4TbTjz03/ljYY=; b=ZlzH8asMJEv2JpGZ/qm8K565Scf7tB0XoqBGflEeJR+WpD/qowztXrXAnTu7KobxUu kNZx6KisDBL22gYLOvyQIBFvs9a83kme6xcwCjGZzIAktZeG1ai55obWI/xXmf6Cm5Cx tFThvMCkJVm3IeXw9tnAktfajV/hNPln+YJuGiZm5hfUvD/aqPVn/TShdNj8iVo+c7Pd LbBglw4vBxVKJ5aUieazw83EGSxD0E4Kb8IwpUt7jL4nwv0JnRme3bpNjfk5X1Ud+kLT 3aTocIz/Idjt8a5y9cU+c/Nc7H80UouuxCh9nEtW7SlT7ayfLWV2U6nGIAeDaAEyEpo7 liCQ== X-Gm-Message-State: AOUpUlH5muSeLOp5p7NSn/A9Bju0Gozk0U8MLZ9laYCFjsP6FcEFZjO4 J1zDvbzPBs9YvkTy7cqRUTPOUJqs X-Google-Smtp-Source: AA+uWPzZgHyN1vbDp7V2YAMBlN0IPEQn9pBPY/K8qbs/3pWwxvuMus9MZNpziFpwr5QeEBkKqLQt8g== X-Received: by 2002:a1c:6d94:: with SMTP id b20-v6mr23874767wmi.28.1534696431429; Sun, 19 Aug 2018 09:33:51 -0700 (PDT) X-Mailer: Apple Mail (2.3445.9.1) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 X-Mailman-Approved-At: Sun, 19 Aug 2018 13:29:12 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14508 Hi, consider this script: #!/bin/bash [ "`whoami`" =3D "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)=20= 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?=20 Is this a known issue? Do you consider it a bug?=20 How would you investigate that further?=20 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`=20= 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-d= ifferently-than-read-if-killed-with-ctrl-c = =