delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/03/20:28:19

X-Spam-Check-By: sourceware.org
Message-ID: <44D29487.6000806@ukf.net>
Date: Fri, 04 Aug 2006 01:27:51 +0100
From: Max Bowsher <maxb1 AT ukf DOT net>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050923 Thunderbird/1.0.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: GnuPG bug: --refresh-keys
References: <44D21D4C DOT 7050200 AT ukf DOT net>
In-Reply-To: <44D21D4C.7050200@ukf.net>
OpenPGP: id=C0F2C580
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

--------------enig5EDAF996C35CA440012FC54E
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Max Bowsher wrote:
> When running 'gpg --refresh-keys', the second updated key results in:
>=20
> gpg: renaming `/home/max/.gnupg/pubring.gpg' to
> `/home/max/.gnupg/pubring.gpg~' failed: Permission denied
> gpg: error writing keyring `/home/max/.gnupg/pubring.gpg': file rename er=
ror
> gpg: key XXXXXXXX: "...." 28 new signatures
> gpg: error reading `[stream]': file rename error
>=20
>=20
> Given that:
>  * this happens for the *second* updated key
>=20
>  * having another process running at the same time, rapidly moving away
> any new pubring.gpg~ files avoids the error
>=20
>  * it is presumably Cygwin-specific
>=20
> it seems extremely likely that gnupg has a file descriptor leak, such
> that when the second key is processed, gnupg still has an open file
> descriptor on the file pubring.gpg~ when it attempts to overwrite it by
> renaming another file onto that name. Windows then objects.


Replying to my own mail...

GPG for some reason tries to cache opened fds for re-use. I suggest
disabling this caching for Cygwin. The appropriate code to tweak is in
util/iobuf.c:fd_cache_close(). I changed the condition of the first if
statement there to always be true, and the problem I reported goes away.

Please integrate this into the Cygwin packages.

Thanks,
Max.


--------------enig5EDAF996C35CA440012FC54E
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iD8DBQFE0pSNfFNSmcDyxYARAraUAKDeX09tMOO7Or4tq+SMfBDostEUEwCgo5Yi
cSFttKZdZdHY/qlHXP2wPB8=
=GvXh
-----END PGP SIGNATURE-----

--------------enig5EDAF996C35CA440012FC54E--

- Raw text -


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