[BUG] pinentry-{gnome3, gtk-2} should set g_log_writer_default_set_use_stderr(true)
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Aug 17 21:12:52 CEST 2026
Hi Kernc--
On Fri 2026-07-17 15:52:24 +0200, Kernc via Gnupg-devel wrote:
> pinentry-gnome3 and pinentry-gtk-2's debug messages are printed to
> stdout, interfering with gpg-agent/pinentry stdout-stream-oriented
> IPC.
Your analysis looks correct to me.
> IMHO, both pinentry-gnome3 and pinentry-gtk-2 should issue
> `g_log_writer_default_set_use_stderr(true)` [1] somewhere early in
> their `main()`. While the default glib behavior seems aptly
> nonsensical, the function docs do warn:
>
>> By default, log messages of levels G_LOG_LEVEL_INFO and G_LOG_LEVEL_DEBUG are sent to stdout, and other log messages are sent to stderr. This is problematic for applications that intend to reserve stdout for structured output such as JSON or XML.
I think your proposal for a fix is reasonable, given the default glib
behavior.
Thanks for noticing this. Please share patches if you've got them!
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 324 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20260817/4d591645/attachment-0005.sig>
More information about the Gnupg-devel
mailing list