delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/01/22/04:07:41

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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=kxEClMs7WfsNrrCS/62RIWULXA407jUW7h5A/saJ2WZwjfW3ffeaz
jUpBxN6igI8HGy69nrHK49n3/Sdkt/kQcGkUuAFqjQ2ddOow3XGBU8GJCXwaCU41
Pjsn+U9XsmWaJKhG/5YFvMoKtJlBiQHPm4AJOTJvtZ4G7YGgt1d2EM=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=2kFJ0KK4xShOFnWLcFpNpZNoPak=; b=mDho2SwOu1xsDH5nBQbTBXlKVuUM
tIcqJ9d/ZZ6dZb6hU/oClNxuxVEsA8uCIk79z3hWWZabQNXMiT2CMAHlYNfobCOT
NXfvLzmXePQb2b1X+z7ZLLgIyRQ/MD4NXHQEUYAOTeYja7t8idFDlPlN+pVo1Ic/
vGh0mGTMuMkMVuE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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-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
Date: Tue, 22 Jan 2019 10:07:25 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT 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 AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <0f030e809f063f5a5e64ff7a7a0c3227 AT xs4all DOT nl> <20190106201950 DOT GC4430 AT calimero DOT vinschen DOT de> <d6431739e2801a80d73e7cb68b4fcc19 AT smtp-cloud8 DOT xs4all DOT net> <20190122090240 DOT GJ2802 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20190122090240.GJ2802@calimero.vinschen.de>
User-Agent: Mutt/1.10.1 (2018-07-13)

--FEz7ebHBGB6b2e8X
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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: <program> -i /dev/fd/N N<<EOF (i.e. Steven Penny's problem)
> >=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"

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019