File U_os-brown-bag-commit-to-fix-957e8d.patch of Package xorg-x11-server.27017

Git-commit: 386fbbe410a1168b724136e54cf3bd37fb64ad4e
Patch-mainline: Upstream
Author: Matthieu Herrb <matthieu@herrb.eu>
Subject: Brown bag commit to fix 957e8d (arc4random_buf() support)
References: bnc#1025084, CVE-2017-2624
Signed-off-by: Michal Srb <msrb@suse.com>

- typo in #ifdef check
- also need to add AC_CHECK_FUNCS([arc4random_buf])

Reported-by Eric Engestrom. Thanks

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>

Index: xorg-server-1.18.3/configure.ac
===================================================================
--- xorg-server-1.18.3.orig/configure.ac
+++ xorg-server-1.18.3/configure.ac
@@ -224,6 +224,7 @@ AC_REPLACE_FUNCS([reallocarray strcasecm
         timingsafe_memcmp])
 
 AC_CHECK_LIB([bsd], [arc4random_buf])
+AC_CHECK_FUNCS([arc4random_buf])
 
 AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
 
Index: xorg-server-1.18.3/os/auth.c
===================================================================
--- xorg-server-1.18.3.orig/os/auth.c
+++ xorg-server-1.18.3/os/auth.c
@@ -305,7 +305,7 @@ GenerateAuthorization(unsigned name_leng
 void
 GenerateRandomData(int len, char *buf)
 {
-#ifdef HAVE_ARC4RANDOMBUF
+#ifdef HAVE_ARC4RANDOM_BUF
     arc4random_buf(buf, len);
 #else
     int fd;
openSUSE Build Service is sponsored by