From: Bruno Haible Date: Wed, 27 May 2020 17:38:36 +0000 (+0200) Subject: crypto/gc: Make more robust in multithreaded applications. X-Git-Tag: v1.0~4046 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=520a9d23e25b4e4ca109f7e264faa40b641d7094;p=gnulib.git crypto/gc: Make more robust in multithreaded applications. * lib/gc-gnulib.c (randomize): Pass an O_CLOEXEC flag to open(). * modules/crypto/gc (Depends-on): Add 'open'. --- diff --git a/ChangeLog b/ChangeLog index 744ab9f0e2..7c6e193946 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-05-28 Bruno Haible + + crypto/gc: Make more robust in multithreaded applications. + * lib/gc-gnulib.c (randomize): Pass an O_CLOEXEC flag to open(). + * modules/crypto/gc (Depends-on): Add 'open'. + 2020-05-28 Bruno Haible copy-file: Make more robust in multithreaded applications. diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index bb62ab1502..8e9b88f075 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -167,7 +167,7 @@ randomize (int level, char *data, size_t datalen) if (strcmp (device, "no") == 0) return GC_RANDOM_ERROR; - fd = open (device, O_RDONLY); + fd = open (device, O_RDONLY | O_CLOEXEC); if (fd < 0) return GC_RANDOM_ERROR; diff --git a/modules/crypto/gc b/modules/crypto/gc index f9f925387a..46ccde1334 100644 --- a/modules/crypto/gc +++ b/modules/crypto/gc @@ -10,6 +10,7 @@ m4/libgcrypt.m4 Depends-on: havelib +open configure.ac: gl_GC