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=Mr3GE9VCPodhCfy7gAqDJxD0nRYPANkanLiKWdwK3BQ56qTIYxjBH nE9pJeRExv5FJLy7YhQ3fhMnePclf9HlGLNQ1wlU/b/5UzOG4lOtayj/kht50z8q tdl/V4usW09xqBFTnIdRVjKM5Rs2l9lmKtYLQYkgTiD7hnxUGktkj8= 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=cWi8PX3oCaLbQh3XO81dko420eM=; b=VCjyQTqau+oN0o6VGM7LfJiKC7a6 UAJcqmALacjHZvIQupce0PQVWpQAIdgeGXwMtwo5thojxae0JJh3lSPphIMcMUVQ 6ZKdDalHSZXw7SInxWChxagJQnxPX7duaP/o4rmn98hHHJnOsgAPUKcKkPBoU4vt bFe4orJga1x4JgI= 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-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Fri, 23 Jan 2015 11:09:38 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: opendir(/dev/fd/n) should fail Message-ID: <20150123100938.GA6276@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20150123094322 DOT GA5612 AT calimero DOT vinschen DOT de> <20150123105430 DOT 210869D0 DOT helmut DOT karlowski AT ish DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: <20150123105430.210869D0.helmut.karlowski@ish.de> User-Agent: Mutt/1.5.23 (2014-03-12) --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jan 23 10:54, Helmut Karlowski wrote: >=20 > -------------------------------------------------- > Corinna Vinschen wrote: > (23/01/2015 10:43) >=20 > > > numerous entries ... > >=20 > > This occurs on Linux as well, just with a few less entries in > > fd (42 rather than 560). These descriptors are apparently > > created by bash for some reason I don't know, and our bash seems > > to create some more descriptors than the newler bash on Linux. >=20 > It's not just bash. The same happens in my home-grown shell. Starting=20 > with /dev/fd/3 opendir succeeds giving (only the opendir-entries): >=20 > [ 752:3]=20 > globit:ksh_opendir:'/dev/fd/3/0/',prefix_len=3D12,hasdot=3D0,fignore=3D48= 4444:'' > [ 752:3]=20 > globit:ksh_opendir:'/dev/fd/3/1/',prefix_len=3D12,hasdot=3D0,fignore=3D48= 4444:'' > [...] Does the above occur with the snapshot? How can I reproduce it? > Linux seems to have has a similar bug. Ok, in that case I lean back a bit. But the above ksh output is weird if it occurs under the snapshot. What I did in Cygwin was to fix the tests for a valid path under /proc/$PID/fd. The next path component must be a valid descriptor as returned by the application $PID. A trailing slash and more path components result in replacing the path with the content of the symlink and the trailing path compenents and restarting the path evaluation. In my subsequent testing I was unable to enter wrong paths, so the above surprises me a bit. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUwh3iAAoJEPU2Bp2uRE+gLfMP/A+fyq80otXpMyBMAqkM8KyW BMywQuhUcY73QFI84voEmGm8ab26EsKJ013eDFZn152b+6YJz56D7viKp+E5jfzJ qcPw3fCCn3mpQofBGd7CNGOS46Zoj0l9FCP728K/li44lR5DJBvB60+zFeSaVUDH kmVo4qpEIozioJ01Htdco7OQQVO5hpd4oQMbn4Y1rj/oPt/z6ivHym/a49JVCrDv mFW6beZ8UhKQcwYDRUnorYOXsu4LfzG7q/QjgmeNjeVrJphJg0mbQYkbZyoBrS20 79AymJJP6s2WJUJwEn6WnpvfX0a3nOePbvMx8hFd4uz4K2TBodMq/0vE/lezWXCb TiqbbGbF7eQBv9ofdSaSFdQzGpH1cQyw3So1kL7DBvoy1lhsEk5/11VPs31tA9sI 6XCFnEZtmZ2bJLZ44rNtdgGRSwp/tWkHy15MEJnHDfz7magYi6PO56HynHrQY3aP cBr2hru0VyY5bGI8sbrqj31u3o5/P8ltvyI/G4kLGFRcfzKSmS5wV1jUTMoz4Kg4 8YBsepLDhlDTRd1KCFY4AylGCmcBYWNG3QEJuqZMTpRIrt86Um7jR88C0GV2AipC N2Ai4x++x56Sf7ov4rekT/LbDDz0Ey4q6Sr+eb+K0ORcZd7JBVHorw8NjZcbQU1u YxkbbN3EC4PGtTSW3NI2 =jBbI -----END PGP SIGNATURE----- --mYCpIKhGyMATD0i+--