delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/01/27/17:12:32

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=qZLtdK9kCZFHz/NsGknZwpWzi+ourWzylxqs4LIw9tb9IyhN7yRGV
l3Im0Dlw2sBFw80gbQ7parvSZSFtLUdrdStGUDAyAsd08bVDwI07D1/H1qOOWUgx
+E0Ja1WZBFmwMXh1tAsM7oDAcTGC67Lf8AhzIroXgS1YM8MSuJQP+Q=
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=hyigI9NZRbBMn46IRqfoHZ4XZgw=; b=ay+xu/mhH8Y814fnyGzqyfkkMJPL
c4pWNgI+aMx6EpFJZI7IRIEDLAu28vSQibSUfgog5YXBNmIMw3Hw9yPz0AJPkncA
audmvYunCaDCX5gEQrYuCwpojX704VLQkJsFyJRZDC+i/U0Gpn8UXEQOF1bVAtlj
ZvUgFUuia5n9hGo=
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,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Yes
X-HELO: mout.kundenserver.de
Date: Sun, 27 Jan 2019 23:12:18 +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: <20190127221218.GJ3912@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20190106201950 DOT GC4430 AT calimero DOT vinschen DOT de> <d6431739e2801a80d73e7cb68b4fcc19 AT smtp-cloud8 DOT xs4all DOT net> <1c60402837d6510667357257b5e96e88 AT xs4all DOT nl> <20190122090633 DOT GK2802 AT calimero DOT vinschen DOT de> <151898514e462bd76cda8a227d4baa16 AT xs4all DOT nl> <20190122094157 DOT GN2802 AT calimero DOT vinschen DOT de> <45382f09a86b6cf3bcabd82adb593622 AT smtp-cloud8 DOT xs4all DOT net> <20190122103928 DOT GO2802 AT calimero DOT vinschen DOT de> <6132284bb44434a89381a695fdd86c7d AT smtp-cloud7 DOT xs4all DOT net> <20190127215721 DOT GH3912 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20190127215721.GH3912@calimero.vinschen.de>
User-Agent: Mutt/1.10.1 (2018-07-13)

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

On Jan 27 22:57, Corinna Vinschen wrote:
> On Jan 27 19:39, Houder wrote:
> > On Tue, 22 Jan 2019 11:39:28, Corinna Vinschen  wrote:
> > >=20
> > > On Jan 22 11:20, Houder wrote:
> > > > On Tue, 22 Jan 2019 10:41:57, Corinna Vinschen  wrote:
> > > > > On Jan 22 10:25, Houder wrote:
> > > > [snip]
> > > >
> > > > > > Curious! It fails (for me) on W7 ...
> > > > >
> > > > > It works for me just as well on W7:
> > [snip]
> >=20
> > > Maybe you should run the above shell session under strace and see if
> > > something unusual crops up.  BLODA?
> >=20
> > NO BLODA.
> >=20
> > Ok, for the record (as this is W7, i.e. pre-pre-W10 :-)
> >=20
> > Using my original STC again: (source code included below)
> >=20
> >  - create file (in /tmp) write-only, write "Hello, world!" to file, clo=
se fd
> >  - open file once more read-only
> >  - unlink file
> >  - open file, using /dev/fd/N, read-write <=3D=3D=3D=3D succeeds (and t=
he handle shown by fcntl is read-write)
> >  - write "*****" to file (using the fd obtained in the previous line), =
lseek to begin of file
> >   - write fails w/ "Permission denied" <=3D=3D=3D=3D so ... the file ca=
nnot be written to?
>=20
> Yes, that scenario fails on W7 but works on W10 1709 and later.  Keep in
> mind that the OS doesn't allow to reopen a file which has been deleted.

... on Windows 8.1 and earlier and (probably, but I can't test this) on
W10 versions prior to 1709.

> Cygwin tries a best effort by duplicating the handle.  A duplicated file
> handle can't have more permissions than the original handle, so if the
> original handle was opened for reading only, the duplicated handle can't
> have write perms.
> [etc]


Corinna

--=20
Corinna Vinschen
Cygwin Maintainer

--eDB11BtaWSyaBkpc
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxOLMIACgkQ9TYGna5E
T6Atxg//RGK+CYSMFg7iUZQX8p1WQPY+8I6P2fwN4AMzf4ncJtXRDgAlbXrj2/KT
WmfYNCusq+fqOy4fkI2AyD4avucdQqAdJTGqonJffTJGpjJcIocrWZxhzvCC3M9N
eEd5gLxXD15E0DSzZs8eQO+HP7EKQSDjnhpj6MQ+KDe4EUBikyhDlx+bdWYjZUUs
xBy4OxWHOtDSedoexcm8QNkOfGmc7tc1xdXkGq1JUOMbAqS70/Gdv1GxVF2oIlRF
7HoLxb0BzDQ4s21nwW46VlJYnczeCb+42Hi8sLvEs8Xg3QntbiNJ1pdtoeSXrKpQ
z9XIa8TVSt+z2kIauzfK1n7Is6zcwqrpPYDI5XUCT/wi8gXEb7UJQAgB2GYu303Z
I7PaLZhaxD05ofVU9gNtaE/LMmSpqHmsbH1gotm764cT0FWzlg0sXfk2uM7lrT+a
faXEGraypBiuQPhI+CeIL7kjuPMAsLB6WKwacoSOpmAEnVLDxvpf0+1GlZyLLaG6
MHHYiGXF0p81lBYSsayricXxCgIdRWr/T4NTVHwCP++5q1XyfoUeWmjsRHU9cTws
F0rDx3sx9jPMbWRxUmzRF35wy07HqW3CEJ/7wjkbBff5gp5m1u11VQeeYUqW+SIF
jmywNyWFdX09v8O8THhWhunLGNOyWe5P/UwOY0+5u4oDHXzgZ20=
=ra5i
-----END PGP SIGNATURE-----

--eDB11BtaWSyaBkpc--

- Raw text -


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