summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xserver/configure12
-rw-r--r--xserver/configure.ac2
-rw-r--r--xserver/include/do-not-use-config.h.in3
-rw-r--r--xserver/os/auth.c2
4 files changed, 16 insertions, 3 deletions
diff --git a/xserver/configure b/xserver/configure
index 7726a7f03..b089d3723 100644
--- a/xserver/configure
+++ b/xserver/configure
@@ -22127,7 +22127,6 @@ esac
fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5
$as_echo_n "checking for arc4random_buf in -lbsd... " >&6; }
if ${ac_cv_lib_bsd_arc4random_buf+:} false; then :
@@ -22173,6 +22172,17 @@ _ACEOF
fi
+for ac_func in arc4random_buf
+do :
+ ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf"
+if test "x$ac_cv_func_arc4random_buf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ARC4RANDOM_BUF 1
+_ACEOF
+
+fi
+done
+
ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
"
diff --git a/xserver/configure.ac b/xserver/configure.ac
index 03cfd6afd..2fcd9edee 100644
--- a/xserver/configure.ac
+++ b/xserver/configure.ac
@@ -222,8 +222,8 @@ AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \
walkcontext])
AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup \
timingsafe_memcmp])
-
AC_CHECK_LIB([bsd], [arc4random_buf])
+AC_CHECK_FUNCS([arc4random_buf])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in
index b3f81a657..bbbe5ab2c 100644
--- a/xserver/include/do-not-use-config.h.in
+++ b/xserver/include/do-not-use-config.h.in
@@ -138,6 +138,9 @@
/* Use Windows sockets */
#undef HAS_WINSOCK
+/* Define to 1 if you have the `arc4random_buf' function. */
+#undef HAVE_ARC4RANDOM_BUF
+
/* Define to 1 if you have the `authdes_create' function. */
#undef HAVE_AUTHDES_CREATE
diff --git a/xserver/os/auth.c b/xserver/os/auth.c
index d8b58a01f..ff73cada2 100644
--- a/xserver/os/auth.c
+++ b/xserver/os/auth.c
@@ -305,7 +305,7 @@ GenerateAuthorization(unsigned name_length,
void
GenerateRandomData(int len, char *buf)
{
-#ifndef HAVE_ARC4RANDOMBUF
+#ifndef HAVE_ARC4RANDOM_BUF
int fd;
fd = open("/dev/urandom", O_RDONLY);