Skip to content
Snippets Groups Projects
Commit 4a71fdf6 authored by Alan Coopersmith's avatar Alan Coopersmith
Browse files

Fix build on Solaris 11.3.0 - 11.3.8

Solaris 11.3.0  added getentropy() to libc and <sys/random.h>
Solaris 11.3.9  added arc4random() to libc and <stdlib.h>
Solaris 11.4.16 added getentropy() to <stdlib.h>

So when building on Solaris releases from 11.3.0 to 11.3.8, libXdmcp
would not find arc4random(), and thus fallback to using getentropy(),
but was only looking for it in <stdlib.h>, resulting in a build error:

Key.c: In function ‘arc4random_buf’:
Key.c:86:5: error: implicit declaration of function ‘getentropy’ [-Werror=implicit-function-declaration]
     ret = getentropy (auth, len);
     ^

Reported-by: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54628



Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 13b72ec5
No related branches found
No related tags found
Loading
Pipeline #517133 passed
......@@ -64,6 +64,11 @@ getbits (long data, unsigned char *dst)
#ifndef HAVE_ARC4RANDOM_BUF
/* Solaris 11.3.0 - 11.4.15 only define getentropy() in <sys/random.h> */
#if HAVE_GETENTROPY && HAVE_SYS_RANDOM_H
# include <sys/random.h>
#endif
static void
insecure_getrandom_buf (unsigned char *auth, int len)
{
......
......@@ -52,6 +52,9 @@ XORG_CHECK_SGML_DOCTOOLS(1.8)
# Checks for programs.
AC_PROG_LN_S
# Checks for header files.
AC_CHECK_HEADERS([sys/random.h])
# Checks for libraries.
AC_SEARCH_LIBS([recvfrom],[socket])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment