Photo ID race condition

Dmitri dmitri@users.sourceforge.net
Mon May 27 19:19:01 2002


--=-AzaZ68uR4RPMwOrnXu5h
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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), GnuP=
G could
> delete the temp file before the viewer finishes initializing.  I can thin=
k of a
> number of solutions:
>=20
> 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=3D/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


--=-AzaZ68uR4RPMwOrnXu5h
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA88mrcXksyLpO6T4IRArRkAKCZkrFAjDwHkuaFdDrELgC9ztS9PwCfS4pY
ahMRn0RVeY4yLBGuc9XW8us=
=x11+
-----END PGP SIGNATURE-----

--=-AzaZ68uR4RPMwOrnXu5h--