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


Groups > gnu.bash.bug > #14508

exec/read -s bug?

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Lars Schneider <larsxschneider@gmail.com>
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 <mailman.5295.1534699754.1292.bug-bash@gnu.org> (permalink)
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 <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14508

Show key headers only | 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