From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25931 invoked by alias); 22 Jan 2019 09:07:30 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 25901 invoked by uid 89); 22 Jan 2019 09:07:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.135) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Jan 2019 09:07:28 +0000 Received: from calimero.vinschen.de ([217.91.18.234]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M1YxX-1gnmty3qx9-0032vB for ; Tue, 22 Jan 2019 10:07:25 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 9BD97A805A3; Tue, 22 Jan 2019 10:07:25 +0100 (CET) Date: Tue, 22 Jan 2019 09:07:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: /dev/fd/N not synonymous with file descriptor N; it is on Linux Message-ID: <20190122090725.GL2802@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <0f030e809f063f5a5e64ff7a7a0c3227@xs4all.nl> <20190106201950.GC4430@calimero.vinschen.de> <20190122090240.GJ2802@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FEz7ebHBGB6b2e8X" Content-Disposition: inline In-Reply-To: <20190122090240.GJ2802@calimero.vinschen.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-01/txt/msg00168.txt.bz2 --FEz7ebHBGB6b2e8X Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1801 On Jan 22 10:02, Corinna Vinschen wrote: > On Jan 22 09:50, Houder wrote: > > On Sun, 6 Jan 2019 21:19:50, Corinna Vinschen wrote: > > > > Also see: > > > > > > > > https://cygwin.com/ml/cygwin/2018-12/msg00028.html > > > > ( Bash heredoc on FD 3 ) > > > > > > > > Based on the output of strace on Linux, I composed an STC, that dup= licates > > > > the steps taken by bash (and cat). > > >=20 > > > This should work in the latest developer snapshot uploaded to > > > https://cygwin.com/snapshots/ Please give it a try. > >=20 > > This solves: -i /dev/fd/N N< >=20 > > Howver ... > > (and I sure that I am not telling you anything new) > > [...] > > 64-@@ rm aap.txt # hacker removing the logfile > >=20 > > 64-@@ stat -L /proc/4120/fd/3 > > File: /proc/4120/fd/3 > > Size: 4 Blocks: 1 IO Block: 65536 regular file > > Device: 33d91880h/869865600d Inode: 35747322042382612 Links: 0 > > Access: (0644/-rw-r--r--) Uid: ( 1000/ Henri) Gid: ( 513/ None) > > Access: 2019-01-22 09:24:41.978178200 +0100 > > Modify: 2019-01-22 09:24:41.978178200 +0100 > > Change: 2019-01-22 09:26:25.021040800 +0100 > > Birth: 2019-01-22 09:24:41.978178200 +0100 > >=20 > > 64-@@ cp /proc/4120/fd/3 noot.txt # logfile rescue > > 64-@@ cat noot.txt # empty! (however, this works on Linux) > > 64-@@ cat /proc/4120/fd/3 # indeed, does not show contents > > 64-@@ >=20 > Yes, this does not work under older systems. However, it works as > desired at least with Windows 10 1709 due to changes in the OS in > terms of handling of deleted files. >=20 > I tested this with W8.1, W10 1709 and W10 1809. It fails on 8.1 ... as expected ... > but works fine on both W10 versions. Corinna --=20 Corinna Vinschen Cygwin Maintainer --FEz7ebHBGB6b2e8X Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxG3U0ACgkQ9TYGna5E T6ALChAAmOPulAOT9bLWFSuZr4CnAaEHcw22DhCOeNYYq5KnzLwnfwqu6m86YGW0 uiybEq+zfnVybOFMko1hRlmr7OO5nx43Ut6mfoeOr0717f9onJATz4OvpgG8iK+z 9CYu22+FnIP9UdrvnhvdxvqBRaghBTt6Su5FKtbYy0/9ad33Ds0yrmFmjJQzPiiw 8QEoZoviXHilWv86aNqtGTD1sw/4iHtYrrkdisXgrNESxt8DqBf7dRpj9QmEZYkj /Hh1KExh1M+A5WaBVRnEnNLYlUaKCn4z4VjFJAOAmcq8k89cnvRLBu8oDR6k1+AE 2bczOt0K+AxezIfEDhI4V5wyjKx3EXRiAszXXGcMTa0opKCAY4QI0GktNx6oYy2q qtGluxJ7xZn72z7+RaRAdxKod+IArRPWWLIuSYpRpJYPPmWBUm/yN6/C6XszdZU3 JDpHAUhBUx3dxVrCZXKGccKMReAax50Z3s9KX7OdyLMrO3wK1NIejqDRvLGu4fCC lL47MRYq/sB9KgXh8ItgoD2GWCAHCx1rnUgum5zATIPO4qJVSfi4wXQSYLjykTbC VRIrzqFMht5amPT4heNbexOKeacFkU+iiWFp9tgjCu2tSoxdJ/uXYNfSDUAoNbeQ ot/Kmx3kpIr2AMhxEYtR78u2FDO0Lav2fHBCv5a804APe2MVj04= =MeBv -----END PGP SIGNATURE----- --FEz7ebHBGB6b2e8X--