From 82a21581c63fc4e453fd4f5cd44e77a95c84f50c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 17 Jan 2022 10:49:13 +0100 Subject: [PATCH] build: Without getrandom() require gnutls 3.7.2 gnutls before 3.7.2 and without getrandom() will open /dev/urandom at library initialization time before main() is run. We use closefrom(3) in samba-bgqd and samba-dcerpd, which closes /dev/urandom, which then breaks gnutls. On system with getrandom(), no file descriptor is opened and gnutls 3.7.2+ will open and close /dev/urandom whenever it needs to access it. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Jan 21 21:42:08 UTC 2022 on sn-devel-184 --- wscript_configure_system_gnutls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wscript_configure_system_gnutls b/wscript_configure_system_gnutls index 9864235d17e..62fe3d5ddda 100644 --- a/wscript_configure_system_gnutls +++ b/wscript_configure_system_gnutls @@ -6,6 +6,10 @@ def parse_version(v): gnutls_min_required_version = "3.4.7" +conf.CHECK_FUNCS('getrandom', headers='sys/random.h') +if not conf.CONFIG_SET('HAVE_GETRANDOM'): + gnutls_min_required_version = "3.7.2" + gnutls_required_version = gnutls_min_required_version conf.CHECK_CFG(package='gnutls',