>From 459f13b0bab1257e631164ed0bee804f84fcb35d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 27 May 2020 19:38:36 +0200 Subject: [PATCH 04/18] 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'. --- ChangeLog | 6 ++++++ lib/gc-gnulib.c | 2 +- modules/crypto/gc | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1c279d7..0945095 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2020-05-27 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-27 Bruno Haible + copy-file: Make more robust in multithreaded applications. * lib/copy-file.c (qcopy_file_preserving): Pass an O_CLOEXEC flag to open(). diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index bb62ab1..8e9b88f 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 f9f9253..46ccde1 100644 --- a/modules/crypto/gc +++ b/modules/crypto/gc @@ -10,6 +10,7 @@ m4/libgcrypt.m4 Depends-on: havelib +open configure.ac: gl_GC -- 2.7.4