From unknown Tue Jun 24 15:39:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25692 <25692@debbugs.gnu.org> To: bug#25692 <25692@debbugs.gnu.org> Subject: Status: [PATCH] sed fails testsuite/panic-tests when tty is not owned by current user Reply-To: bug#25692 <25692@debbugs.gnu.org> Date: Tue, 24 Jun 2025 22:39:43 +0000 retitle 25692 [PATCH] sed fails testsuite/panic-tests when tty is not owned= by current user reassign 25692 sed submitter 25692 Kent Fredric severity 25692 normal tag 25692 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 12:24:33 2017 Received: (at submit) by debbugs.gnu.org; 11 Feb 2017 17:24:33 +0000 Received: from localhost ([127.0.0.1]:35878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccbPV-0007bq-98 for submit@debbugs.gnu.org; Sat, 11 Feb 2017 12:24:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccX49-0007jj-VS for submit@debbugs.gnu.org; Sat, 11 Feb 2017 07:46:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccX43-0003hM-3r for submit@debbugs.gnu.org; Sat, 11 Feb 2017 07:46:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccX43-0003hH-0j for submit@debbugs.gnu.org; Sat, 11 Feb 2017 07:46:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccX41-00053V-GT for bug-sed@gnu.org; Sat, 11 Feb 2017 07:46:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccX3y-0003ft-Eh for bug-sed@gnu.org; Sat, 11 Feb 2017 07:46:05 -0500 Received: from smtp.gentoo.org ([140.211.166.183]:49468) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccX3y-0003fb-4S for bug-sed@gnu.org; Sat, 11 Feb 2017 07:46:02 -0500 Received: from katipo2.lan (unknown [IPv6:2406:e001:1:d01:de0e:a1ff:fea1:6ec4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kentnl) by smtp.gentoo.org (Postfix) with ESMTPSA id 3140D34105A for ; Sat, 11 Feb 2017 12:45:58 +0000 (UTC) Date: Sun, 12 Feb 2017 01:45:27 +1300 From: Kent Fredric To: bug-sed@gnu.org Subject: [PATCH] sed fails testsuite/panic-tests when tty is not owned by current user Message-ID: <20170212014527.3c23f96a@katipo2.lan> Organization: Gentoo X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/ScGh5d/9G/ypjVbCxBKbf4S"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 11 Feb 2017 12:24:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) --Sig_/ScGh5d/9G/ypjVbCxBKbf4S Content-Type: multipart/mixed; boundary="MP_/KrK63xgLX5T_kO=.0Y32Geu" --MP_/KrK63xgLX5T_kO=.0Y32Geu Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline If the tty is owned by a privileged user, and that privileged user is build= ing sed after changing UID, the state of the tty's may look as follows: > tty /dev/pts/9 > ls -la $(tty) crw--w---- 1 root tty 136, 9 Feb 12 01:27 /dev/pts/9 > whoami builder > if [[ -r $(tty) ]]; then echo "readable"; else echo "not readable"; fi not readable This leads to the test producing the following diff: FAIL: testsuite/panic-tests =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D --- exp-err-tty 2017-01-06 15:42:36.073141748 +1300 +++ err-tty 2017-01-06 15:42:36.086141949 +1300 @@ -1 +1 @@ -sed: couldn't edit X: is a terminal +sed: can't read /dev/pts/3: Permission denied FAIL testsuite/panic-tests.sh (exit status: 1) And failing. This failure makes sense however, and there's no sane way I know of to make the terminal readable, other than demanding sed run the test inside a pty it created. So an effective workaround is just guard the test with a -r check like it presently has for -w , because the tty dev can't be read for sed to decide "its a tty" in this condition. Tested patch that adds this trivial check attached. Thanks. --- Downstream Bug: https://bugs.gentoo.org/show_bug.cgi?id=3D604798 --MP_/KrK63xgLX5T_kO=.0Y32Geu Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=sed-4.3-test-pty-readable.patch =46rom 0fa312e2052e293ffca338fa0f4fa71eb3bc5239 Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Sun, 8 Jan 2017 14:36:32 +1300 Subject: [PATCH] Ensure tty device is readable before running test Unreadable tty's fail with a different permissions error instead of failing with "is a tty" error. --- testsuite/panic-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/panic-tests.sh b/testsuite/panic-tests.sh index a2dba00..00a7090 100644 --- a/testsuite/panic-tests.sh +++ b/testsuite/panic-tests.sh @@ -87,7 +87,7 @@ EOF =20 ttydev=3Dno-such-file type tty >/dev/null 2>&1 && ttydev=3D$(tty 2>/dev/null) -if test -w "$ttydev" ; then +if test -w "$ttydev" && test -r "$ttydev" ; then returns_ 4 sed -i =3D "$ttydev" 2>err-tty || fail=3D1 =20 # remove the actual terminal device name (using sed itself...) --=20 2.11.0 --MP_/KrK63xgLX5T_kO=.0Y32Geu-- --Sig_/ScGh5d/9G/ypjVbCxBKbf4S Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEPZazbI/qrFT1o9rn6FQySxNmqCAFAlifB3MACgkQ6FQySxNm qCC9jg/9Fhq+uAFNKWjitvn/gKHh8zbQZdpPBqO9WWWr7lkD0pwKGBo6Rdc4W0UC cIZ8W/+U6WQjE9nVKbnbjLBU89FW7DkVWvyNE1pFgtjPRALb5fTo6bc7+b0vqgjq iYq3zDzif/oJmMrGonwqSHviS0YkYztJh5umNey1681w7C+JPKiHXOho6/C8qtGO VSmlZLdfx4rIr83hbzUJat102pu1jR2dm58H7DOCZtw5NhxXsVsNLjYxQqN+hre5 2l5JqcNXy5ZBE5ek3ck8Bld+DTAVFmsRAOVlhhcHfzawqSmRGcITVVdekMaEIxYC w57UFN8O70EAR+GXOSwYTF4EVwNY6zlS0pyXp3QX3kXIpBJ8AxlEnNzH5ijPGvH+ uuRB8cER+bopIOxlqiD7saDcVF+cjFjKbSxlyVT6wq9RMIbQmvr6FKQVYwfJ088m EtLBB3ubpu+uKtepuGPqRNJOn6/xAn3HlMrcRoU08WxUIfQdznL3/jwRG1QOetPI 6JQw9ttqFm/hPrbX7Yxme6SwrNgIqjSa2jQXR7AtV0eML4GqG0gRRJt7TYWMvM7m HDgzINFIzRIjKfQ6LDDUhr1apkJOK87uIjSJB1uVK7/W3oDfawYyBydIBvNH4T2L 4T1nebKmdiGB+/Q5xZE1ohrif2bf7zlCYDfwN6+doYRzs8PuiKI= =xwgX -----END PGP SIGNATURE----- --Sig_/ScGh5d/9G/ypjVbCxBKbf4S-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 11 16:22:56 2017 Received: (at 25692) by debbugs.gnu.org; 11 Feb 2017 21:22:56 +0000 Received: from localhost ([127.0.0.1]:35989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccf8C-0006Eu-Gt for submit@debbugs.gnu.org; Sat, 11 Feb 2017 16:22:56 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:32775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccf8B-0006Ei-4P for 25692@debbugs.gnu.org; Sat, 11 Feb 2017 16:22:55 -0500 Received: by mail-qt0-f196.google.com with SMTP id n13so8523316qtc.0 for <25692@debbugs.gnu.org>; Sat, 11 Feb 2017 13:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+oQbTMyEcKH8dRXFAiMCcGJcZRqRQyJLPAaoKheY968=; b=p3KYehbYQ3LsYDlvpBLhJ4Ku1ChKkQ2+LgPfMiZUjvNnffmalggNssAonNUsdRsJxv wmIoK6qHVTmriYKN3tNtGLnZYzgDirRQFwbKCejZMhQx3Y3yhQZOOi1m7iVRg4fSjg70 cVcEmWk/yf1YLgRfGl6sL7FuItwpl3qtrApS/aw4B/1gWu/x+XXAwSgPHWb3vTvdlEHi Gh4d/1orMIJ1sDCRWakuRCtSu3lR8FZYGlJT2JgFozuY3QoBtzhiwEfmFtvU55cGKQNm Yzxp1GVBiI2YYGgitzErA2xPk6rifHW16H/zuke7RZYSnKofyqrUPesJXJ1EKt/vfrl/ qRsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+oQbTMyEcKH8dRXFAiMCcGJcZRqRQyJLPAaoKheY968=; b=AwtaAQRmGkTiWQMMcx21Bgx0Vp7teCEtwlL61ieiIwIKoO6S1MR0cCltMCBUf1cDqO /amr0CL++whpOihj8TeZTfym9epDBaodC7wMsU/mMfg9A2MxD5v5zW37icgs61XIQqbW F0yTgF8CJ9ZmtcAptdu61MVxh/ccVc+4dEdjwScSrZdMj2hrH3qpTh7QXaBNsj6XWrSC 2HCZ+rLxiaKF1T5i4Iiexk7CyH5+5BcHvpYcv+Ora/BNCv5WxzzjDLalEvxbURpZ7hBd TOgCSZ7TgaltVNxN4VG7J6gUC3sKMtclyv/FWTQXDw5Slp/ibnwZiSPAwEagpoYKfhlw nfWg== X-Gm-Message-State: AMke39mgXQ+iN30aHFYoxiVJcSBhgx/8MxwLRthGDAVXhGg9G04m3VvcDdv96TjGHaKlHQ== X-Received: by 10.237.41.229 with SMTP id o92mr13511915qtd.223.1486848169720; Sat, 11 Feb 2017 13:22:49 -0800 (PST) Received: from gmail.com (housegordon.org. [104.236.108.240]) by smtp.gmail.com with ESMTPSA id h184sm2684147qkf.68.2017.02.11.13.22.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Feb 2017 13:22:49 -0800 (PST) Date: Sat, 11 Feb 2017 21:22:19 +0000 From: Assaf Gordon To: Kent Fredric Subject: Re: bug#25692: [PATCH] sed fails testsuite/panic-tests when tty is not owned by current user Message-ID: <20170211212218.GA24094@gmail.com> References: <20170212014527.3c23f96a@katipo2.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170212014527.3c23f96a@katipo2.lan> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 25692 Cc: 25692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) Hello Kent, On Sun, Feb 12, 2017 at 01:45:27AM +1300, Kent Fredric wrote: >If the tty is owned by a privileged user, and that privileged user is building >sed after changing UID, the state of the tty's may look as follows: [...] >FAIL: testsuite/panic-tests Thank you for the report. I'll look into it soon. But before that: >Downstream Bug: https://bugs.gentoo.org/show_bug.cgi?id=604798 sed-4.3 contained a bug which could lead to segfault, and we've released sed-4.4 shortly after. If you are involved in packaging sed for gentoo, I highly recommend to upgrade. Please see more details in a similar bugreport we've submitted for debian: https://bugs.debian.org/853864 regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 21 21:04:36 2017 Received: (at 25692) by debbugs.gnu.org; 22 Mar 2017 01:04:36 +0000 Received: from localhost ([127.0.0.1]:38463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqUhX-00019q-VA for submit@debbugs.gnu.org; Tue, 21 Mar 2017 21:04:36 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqUhW-00019b-Np; Tue, 21 Mar 2017 21:04:35 -0400 Received: by mail-qk0-f194.google.com with SMTP id j127so24401466qke.0; Tue, 21 Mar 2017 18:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yip3iUjb7N7a56qspwshaUxVt/2wgkttX/e5wRwHjfQ=; b=qH6/Wb72DcIIzq1Ei6VDGarQTJvLj78Ynio6ub4X0CTI5tbNCTRrOY6HT7uKMuyY94 i/TlpCHVmCCXw6M4CtggKFIJeKIIJ5qn04+qRKsiWMHHqrYaB8bIj3GjZq0BNNtbmrdc KQHfIAakMMGdmtUz42Uep3+F7T4OMtIivqJ/0+m6+PyHvZ6ur3CsT2a+Eo+EMcuBARZo ZjVVyGkDa4ELRTKEQ0SgsOSWA0k1k8MSIrqXMsBaSp6OlHGQXlAVDAQhI0ejqfPLVUzq 85+qIIquVEaIus5q2vjV/j7oLdK8TvTJ8almbC3cls1x//UHRcBCbVICvRf826G2GkBY ELZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Yip3iUjb7N7a56qspwshaUxVt/2wgkttX/e5wRwHjfQ=; b=D6gvDA//osaE38CDisXwgiekVtUdSaOtAW8TioXHdMqNt83W7A4aY1NO4Q7Dviqe/Y HrSjbAH20CexdkEww7pdGlZwyvhmPq4raZOpM89L55GhHYvg3SwA3vArlWLO0UhVnPrH fRBkz0uDZrGFFoO/h8C98dPoRxA6s/Ya+cYmOU6uU4GtwBtg6DDhcu3Sq+aOMGzJagmm bhLRqt7ofIq7ZJb1GzpEPIG1eYCF0QxNNySRU9mIwSepkt1W7lt36VCeOVLYPONRXJMt rjqERpVf/0llFA5e+y6HR/zyTZXuHMYO8+pDRqviPKnS8+GLmaVH7+xjOhkf1hKY+8hY ZmzA== X-Gm-Message-State: AFeK/H2rTT27BPDXbtfbBXY243wbsmu1QRLjEwYv/yhqrPyhKGgEaCbGKxC/h/LOp+3npA== X-Received: by 10.55.3.151 with SMTP id 145mr32035111qkd.244.1490144669139; Tue, 21 Mar 2017 18:04:29 -0700 (PDT) Received: from gmail.com (housegordon.org. [104.236.108.240]) by smtp.gmail.com with ESMTPSA id q67sm3565750qkl.19.2017.03.21.18.04.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Mar 2017 18:04:27 -0700 (PDT) Date: Wed, 22 Mar 2017 01:03:58 +0000 From: Assaf Gordon To: Kent Fredric Subject: Re: bug#25692: [PATCH] sed fails testsuite/panic-tests when tty is not owned by current user Message-ID: <20170322010355.GA27091@gmail.com> References: <20170212014527.3c23f96a@katipo2.lan> <20170211212218.GA24094@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170211212218.GA24094@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25692 Cc: 25692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) tag 25692 fixed close 25692 stop Hello, On Sat, Feb 11, 2017 at 09:22:19PM +0000, Assaf Gordon wrote: >Hello Kent, > >On Sun, Feb 12, 2017 at 01:45:27AM +1300, Kent Fredric wrote: > >>If the tty is owned by a privileged user, and that privileged user is building >>sed after changing UID, the state of the tty's may look as follows: Pushed here: https://git.savannah.gnu.org/cgit/sed.git/commit/?id=b092d4a6c07b Thanks, - assaf From unknown Tue Jun 24 15:39:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 19 Apr 2017 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator