Page MenuHome GnuPG

gpgme: Treat empty DISPLAY variable as unset or error out
Testing, NormalPublic

Description

When the DISPLAY env variable is set but empty gpgme can construct an invalid gpg command in engine-gpg.c$702 and error out in unexpected ways. This can be easily reproduced when running the test suite with DISPLAY='' where it fails with different errors, GPGME: Invalid crypto engine, GnuPG: General error, GPGME: No data... Enabling debug shows this:

_gpgme_io_read: check: [GNUPG:] FAILURE option-parser 33554433<LF>
(...)
_gpgme_io_read: check: gpg: missing argument for option "--display="<LF>

I think gpgme could handle this situation or at least it should explicitly throw and error or find some way to pass the empty string to gpg. I'm attaching a patch here to skip adding --display= if its empty in a similar way as it was done for gnupg in 0076bef2026a. Let me know if this is a valid approach.

TIA

Details

Version
2.0.1

Revisions and Commits

Event Timeline

pmgdeb renamed this task from Treat empty DISPLAY variable as unset or error out to gpgme: Treat empty DISPLAY variable as unset or error out.Nov 14 2025, 12:40 PM
werner added a subscriber: werner.

I considered to make the --display argument optional but that still leads to the error. Thus better do not set or send it at all. I did this now for all gpgme engines.

werner triaged this task as Normal priority.Nov 14 2025, 1:19 PM
werner changed the task status from Open to Testing.Nov 14 2025, 1:26 PM
werner moved this task from Backlog to QA for next release on the gpgme board.