From b43f4229758ff8e78897e03c386025cf4de3a200 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Fri, 29 Nov 2024 16:32:06 -0500 Subject: [PATCH] Check for sys/random.h The function getentropy() is supported on newer versions of MacOS X, but requires the include file sys/random.h. Check for that and include it where getentropy() is used. ticket: 9149 --- src/configure.ac | 2 +- src/lib/crypto/krb/prng.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/configure.ac b/src/configure.ac index 10a5d1a741..9d4e08a708 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -490,7 +490,7 @@ AC_SUBST(GETTIMEOFDAY_ST_OBJ) AC_SUBST(EXTRA_SUPPORT_SYMS) DECLARE_SYS_ERRLIST -AC_CHECK_HEADERS(unistd.h paths.h regex.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h byteswap.h machine/endian.h machine/byte_order.h sys/bswap.h endian.h pwd.h arpa/inet.h alloca.h dlfcn.h limits.h) +AC_CHECK_HEADERS(unistd.h paths.h regex.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h byteswap.h machine/endian.h machine/byte_order.h sys/bswap.h endian.h pwd.h arpa/inet.h alloca.h dlfcn.h limits.h sys/random.h) AC_CHECK_HEADER(regexp.h, [], [], [#define INIT char *sp = instring; #define GETC() (*sp++) diff --git a/src/lib/crypto/krb/prng.c b/src/lib/crypto/krb/prng.c index a9c1668157..4a6464558c 100644 --- a/src/lib/crypto/krb/prng.c +++ b/src/lib/crypto/krb/prng.c @@ -56,6 +56,9 @@ get_os_entropy(unsigned char *buf, size_t len) #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_SYS_RANDOM_H +#include +#endif #ifdef __linux__ #include #endif /* __linux__ */ -- 2.47.2