/dev/tty does not work from shell

Eric Blake eblake@redhat.com
Tue Feb 10 16:33:00 GMT 2015


On 02/10/2015 09:28 AM, Eric Blake wrote:
> 
> 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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150210/e7e51c1d/attachment.sig>


More information about the Cygwin mailing list