X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type; q=dns; s=default; b=CKepfu ZwGUSYCmUFSjRQFJ9vukt/2hz5U07qd2PFxCr8GGactEC6WdzWTzs7CorOt2hwJ3 49pprIN8EhRwiQEbJJRHqR859t0ghitfWSpJvOR0OwImhnJOKID7doUpznzIpThA iHJIakQDg+roln+By3bfhdza4ykbACAmLXeao= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type; s=default; bh=SurbTjBRcYnQ eShxPxuFGAQhSsE=; b=s5K7L/NxeyjAvHsjI6BFpMV+joLt5TV210F2S5R7hJCG jvVEG3+bqXg4Fj1r9Aocke9Ozruww3W0zN7Cxh52Yym2G9ya+RODfyZRZBYlXLYH 2Cleb8azAjZqIXA39Y+Z1DW5+a2xbUjq7j5qj48GwB0mLI49ACTbslrZG3z2T1s= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <54DA32D9.5070909@redhat.com> Date: Tue, 10 Feb 2015 09:33:29 -0700 From: Eric Blake User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: /dev/tty does not work from shell References: <1598899839 DOT 20150209072327 AT yandex DOT ru> <54D8741A DOT 5020805 AT towo DOT net> <20150209113620 DOT F876DF38 DOT helmut DOT karlowski AT ish DOT de> <54D91AC6 DOT 8030101 AT towo DOT net> <54D91E53 DOT 5080907 AT redhat DOT com> <54DA31C1 DOT 9060406 AT redhat DOT com> In-Reply-To: <54DA31C1.9060406@redhat.com> OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="INBf7pixIO9Qc5bJSeCCGj3VPdwxwvh88" X-IsSubscribed: yes --INBf7pixIO9Qc5bJSeCCGj3VPdwxwvh88 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/10/2015 09:28 AM, Eric Blake wrote: >=20 > The bug is in cygwin1.dll, not bash. Here's a STC; opening a file > should NOT change its st_ino number, but that's exactly what cygwin is > doing to /dev/tty. As such, bash thinks that because the ino changed > between stat() and open() that there is a race of someone trying to do > bad things behind bash's back, and noclobber restrictions kick in to > prevent bash from using the file. The same test from the command line: $ stat -c %i /dev/tty - 0>/dev/tty 327680 8912896 use any other (already-existing) file to see that the two numbers should normally be the same. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --INBf7pixIO9Qc5bJSeCCGj3VPdwxwvh88 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU2jLZAAoJEKeha0olJ0NqlCUH/21czReZSSvZ46zU2LpaDiHx 7HVb/S6WweU3T2zpGc5g11hIuKJ5B//Dkxzq9ruhEJiYMSBif/cDR1cTfnm+UA3y 3pyV8jkXvNI9eVJywbfCuh/5j05dU4jcPzqK0zJnRn/X7Oy+9h8dWUDMMa4sghxU nKSRK2eQKFYBRKI5YrKfUwJ1ZyhxduqO1x4XCxLejPK8DejHfsECx4HytXCW4wnl gdVArhpZRZ7l2MUhaujpHt3CzRNuKNnaQbnjUNViAWWCZj9kgrAaMO9prSb3ak/X hDBTYBAetRgeya4fpdSU+JOT3iddUByWYfguietcXpioJfFYCN+FLVJP+vdNTx4= =SRjv -----END PGP SIGNATURE----- --INBf7pixIO9Qc5bJSeCCGj3VPdwxwvh88--