From: Mike Yuan Date: Thu, 2 Jan 2025 18:59:56 +0000 (+0100) Subject: random-util: drop needless conditionalization of sys/auxv.h X-Git-Tag: v258-rc1~1745^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2627cd13435f6af40a49288f401b6121efb49580;p=thirdparty%2Fsystemd.git random-util: drop needless conditionalization of sys/auxv.h We assume its existence in basic/build-path.c, shared/userdb.c, and coredump/coredump.c already, for which nothing has been reported so far. So this seems safe to drop. --- diff --git a/meson.build b/meson.build index 6b81203168b..d9fb8fb6130 100644 --- a/meson.build +++ b/meson.build @@ -773,7 +773,6 @@ endif foreach header : ['crypt.h', 'linux/ioprio.h', 'linux/time_types.h', - 'sys/auxv.h', 'sys/sdt.h', 'threads.h', 'valgrind/memcheck.h', diff --git a/src/basic/random-util.c b/src/basic/random-util.c index 4069b290d55..0b767a85009 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -8,13 +8,10 @@ #include #include #include +#include #include #include -#if HAVE_SYS_AUXV_H -# include -#endif - #include "alloc-util.h" #include "env-util.h" #include "errno-util.h" @@ -31,7 +28,7 @@ #include "sha256.h" #include "time-util.h" -/* This is a "best effort" kind of thing, but has no real security value. So, this should only be used by +/* This is a "best effort" kind of thing, but has no real security value. So, this should only be used by * random_bytes(), which is not meant for crypto. This could be made better, but we're *not* trying to roll a * userspace prng here, or even have forward secrecy, but rather just do the shortest thing that is at least * better than libc rand(). */ @@ -53,9 +50,7 @@ static void fallback_random_bytes(void *p, size_t n) { .tid = gettid(), }; -#if HAVE_SYS_AUXV_H memcpy(state.auxval, ULONG_TO_PTR(getauxval(AT_RANDOM)), sizeof(state.auxval)); -#endif while (n > 0) { struct sha256_ctx ctx;