Photo ID race condition

Dmitri dmitri at users.sourceforge.net
Mon May 27 20:19:01 CEST 2002


On Mon, 2002-05-27 at 09:54, Keith Ray wrote:

> There is a (non-security) race condition in the photo ID code under
> Windows.  If the user has a slow loading image viewer (ie. Mozilla), GnuPG could
> delete the temp file before the viewer finishes initializing.  I can think of a
> number of solutions:
> 
> 1. Wait for the viewer to exit before returning to GnuPG.

GnuPG actually won't stop running. But this seems to be the right
solution. See CreateProcess() and OpenProcess() here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/prothred_9dpv.asp

> 2. Insert a delay between exec_read() and exec_finish().  Then again, on a slow
> system with little RAM, how much is enough?

Fudge factor works only in 27% of all cases ;-)

> 3. Delay deleting the temp files until GnuPG exits.

Dmitri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
Url : /pipermail/attachments/20020527/f3eecdbb/attachment.bin


More information about the Gnupg-devel mailing list