Bug in GPGME's edit key interface

Marcus Brinkmann Marcus.Brinkmann at ruhr-uni-bochum.de
Thu Aug 22 17:46:01 CEST 2002


On Thu, Aug 22, 2002 at 03:20:20PM +0200, Miguel Coca wrote:
> I think I've found a bug in the experimental key edit interface. Maybe it's
> not a bug, and then it can be considered a feature request on my part :-)

Uhm, yeah, it is a deep bug indeed, and not easy to fix.
 
> The problem is that the return value of the callback (a GpgmeError) is not
> used at all. I expected that returning an error from it would stop the
> operation and report that error back to the caller of gpgme_op_edit().

There is a fundamental problem with terminating operations.  Even
cancellation is not guaranteed to work.

I will have to work on this, but it will take a while until I come up with a
sound design for this.  I don't think it is too hard to make it work
reliably, but it requires some changes to the way operations are run, and
that is hairy stuff (it must work for all ways to run operations, eg
synchronous with gpgme_wait, but also asynchronous with external IO
callbacks), and I must test that thoroughly.

For now, I can only recommend to return the error value, and then the next
time your edit callback is run, you can ignore all further normal output and
just return the quit command at the next prompt.  When the operation
terminates, you should see the error value you returned (if not, let me
know).

> What would be the way to make the edit operation return an error? Other than
> using gpgme_cancel() and somehow returning an error code via the callback
> data, I mean.

cancel wouldn't work any better if you are using an external event loop. 

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus at gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann at ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/




More information about the Gnupg-devel mailing list