Re: [BUG] pinentry-{gnome3, gtk-2} should set g_log_writer_default_set_use_stderr(true)

Daniel Kahn Gillmor <[email protected]>
Newsgroups gmane.comp.encryption.gpg.devel
Message-ID <[email protected]>
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

_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
signature.asc (application/pgp-signature, 324 B)
-----BEGIN PGP SIGNATURE-----

wr0EARYKAG8FgmqDXTQJEHgLhU7ZwrSWRxQAAAAAAB4AIHNhbHRAbm90YXRpb25z
LnNlcXVvaWEtcGdwLm9yZyfNbpPGSgDjs+tNfGRb2jBL6swL1Ac8y/LHHl553NDF
FiEEY6wRjlsuXWbIioWneAuFTtnCtJYAALLiAQCW+4m5hLbc/dXWOuhsHgIVUENh
KmMmkF2lI0hqyBu8qAEAtfPVlWKXRFoxhNFswqh54AcSAGZ5z9BUa7QUlZnBUg4=
=TzjY
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.