Home GnuPG
Diffusion GPGME 59fe3f26c1ca

core: Support non-thread-safe getenv.

Description

core: Support non-thread-safe getenv.

* src/get-env.c (_gpgme_getenv): Use gpgrt_lock_lock
and gpgrt_lock_unlock to protect call of getnev.
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Feb 27 2018, 10:43 AM
Parents
rMc58f61e92226: WS removal
Branches
Unknown
Tags
Unknown

Event Timeline

The problem is still that other - non-gpgme threads - can still use getenv and friends without us noticing that. But I see no solution for this. In any case this code is the best we can do.

We may eventually want to a gpgrt_getenv to libgpg-error and offer it to other applications as a safe getenv wrapper.