Home GnuPG
Diffusion GPGME 129def87b262

core, w32: Add hack to translate diag logger-fd

Description

core, w32: Add hack to translate diag logger-fd

* src/assuan-support.c (my_spawn): Add hack to
mark the logger fd for w32spawn translation.

The w32 spawn code needs to modify argv with
an updated fd that matches the real id
in the spawned process.

It uses spawn_fd_item_s.arg_loc for that.
We hack it here so that the arg_loc is set
for gpgsm's logger-fd without changing
the assuan API.

Details

Provenance
aheineckeAuthored on Mar 25 2019, 2:56 PM
Parents
rM47369569e234: qt: Handle diagnostic audit log for CMS
Branches
Unknown
Tags
Unknown
Tasks
T4426: GpgOL: Diagnostic output for failed crypto operations

Event Timeline

werner added inline comments.
/src/assuan-support.c
237

That should either be strtol (because logger_fd is a long) or if you change logger-fd to an ulong you need to use the errno=0/strtoul/if dance fortunately available as _gpgme_strtoul_field.

I changed it. My rationale to check for <=0 here was to catch "-1" invalid handle values that might be somehow created / passed and not caught earlier.