[PATCH] Add inside-Emacs mode to GUI pinentry programs

Neal H. Walfield neal at walfield.org
Fri Jun 12 12:23:24 CEST 2015


Hi Daiki,

Sorry for the delay in replying.  I was traveling.

At Tue, 09 Jun 2015 16:49:38 +0900,
Daiki Ueno wrote:
> Good point, but should we consider the case where pinentry_inside_emacs
> is called multiple times?  Assuming not, I added an assertion in
> pinentry_emacs_init to prevent the socket being initialized twice, and
> renamed pinentry_inside_emacs to a clearer name denoting a side effect:
> pinentry_enable_emacs_cmd_handler.
> 
> Also, I moved the call to the function right after pinentry_parse_opts,
> aiming for the option dependent behavior, which I wrote in the reply to
> Daniel:
> 
> > GnuPG not to interact with Emacs.  In that case, it might make sense to
> > add an option to pinentry.conf, e.g., {no-,}allow-emacs-pinentry.
> >
> > I will try to add it in the new patch.
> 
> I postpone this for now, since it turned out that it requires a change
> in GnuPG.

Is any change actually required on the pinentry side?  If gpg-agent
doesn't pass the INSIDE_EMACS environment variable through, then emacs
support is automatically disabled.

> +/* Enable pinentry command handler which interacts with Emacs, if
> +   INSIDE_EMACS envvar is set.  This function should be called once,
> +   right before pinentry_loop call.  */
> +void pinentry_enable_emacs_cmd_handler (void);

I'm not convinced that this is the right construct.  Why don't we just
let pinentry_parse_opts do this.  Also, why don't you modify the
curses and tty frontends to support emacs?

Thanks!

:) Neal



More information about the Gnupg-devel mailing list