2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

Do not assume all Linux has linux/random.h.

Add missing sys/syscall.h include
This commit is contained in:
Todd C. Miller 2018-08-22 15:12:11 -06:00
parent fe58062547
commit d876602dbf
4 changed files with 24 additions and 3 deletions

View File

@ -467,6 +467,9 @@
/* Define to 1 to enable Linux audit support. */
#undef HAVE_LINUX_AUDIT
/* Define to 1 if you have the <linux/random.h> header file. */
#undef HAVE_LINUX_RANDOM_H
/* Define to 1 if you have the `lockf' function. */
#undef HAVE_LOCKF

13
configure vendored
View File

@ -15953,6 +15953,19 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_SECCOMP_SET_MODE_FILTER $ac_have_decl
_ACEOF
# We call getrandom via syscall(3) in case it is not in libc
for ac_header in linux/random.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "linux/random.h" "ac_cv_header_linux_random_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_random_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LINUX_RANDOM_H 1
_ACEOF
fi
done
;;
*-*-gnu*)
# lockf() is broken on the Hurd

View File

@ -2058,6 +2058,8 @@ case "$host" in
#include <linux/seccomp.h>
#include <linux/filter.h>
])
# We call getrandom via syscall(3) in case it is not in libc
AC_CHECK_HEADERS([linux/random.h])
;;
*-*-gnu*)
# lockf() is broken on the Hurd

View File

@ -35,7 +35,10 @@
#endif
#include <sys/stat.h>
#include <sys/time.h>
#ifdef __linux__
#ifdef HAVE_SYS_SYSCALL
# include <sys/syscall.h>
#endif
#ifdef HAVE_LINUX_RANDOM_H
# include <linux/types.h>
# include <linux/random.h>
#endif