Module Name: xsrc
Committed By: mrg
Date: Wed Mar 8 07:44:16 UTC 2017
Modified Files:
xsrc/external/mit/xorg-server.old/dist: configure.ac
xsrc/external/mit/xorg-server.old/dist/include: dix-config.h.in
xsrc/external/mit/xorg-server.old/dist/os: auth.c
xsrc/external/mit/xorg-server.old/include: dix-config.h
Log Message:
port to xorg-server 1.10:
apply
https://cgit.freedesktop.org/xorg/xserver/commit/?id=957e8db38f27932d353e86e9aa69cf16778b18f1
--
Use arc4random_buf(3) if available to generate cookies.
Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Matthieu Herrb <[email protected]>
--
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xorg-server.old/dist/configure.ac
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xorg-server.old/dist/include/dix-config.h.in
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xorg-server.old/dist/os/auth.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xorg-server.old/include/dix-config.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xorg-server.old/dist/configure.ac
diff -u xsrc/external/mit/xorg-server.old/dist/configure.ac:1.1.1.1 xsrc/external/mit/xorg-server.old/dist/configure.ac:1.2
--- xsrc/external/mit/xorg-server.old/dist/configure.ac:1.1.1.1 Thu Jun 9 09:07:55 2016
+++ xsrc/external/mit/xorg-server.old/dist/configure.ac Wed Mar 8 07:44:16 2017
@@ -220,6 +220,8 @@ AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_S
AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
+AC_CHECK_LIB([bsd], [arc4random_buf])
+
dnl Check for mmap support for Xvfb
AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.]))
Index: xsrc/external/mit/xorg-server.old/dist/include/dix-config.h.in
diff -u xsrc/external/mit/xorg-server.old/dist/include/dix-config.h.in:1.2 xsrc/external/mit/xorg-server.old/dist/include/dix-config.h.in:1.3
--- xsrc/external/mit/xorg-server.old/dist/include/dix-config.h.in:1.2 Wed Mar 8 07:31:42 2017
+++ xsrc/external/mit/xorg-server.old/dist/include/dix-config.h.in Wed Mar 8 07:44:16 2017
@@ -133,6 +133,9 @@
/* Build a standalone xpbproxy */
#undef STANDALONE_XPBPROXY
+/* Define to 1 if you have the `bsd' library (-lbsd). */
+#undef HAVE_LIBBSD
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
@@ -160,6 +163,9 @@
/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
#undef HAVE_RPCSVC_DBM_H
+/* Define to 1 if you have the `arc4random_buf' function. */
+#undef HAVE_ARC4RANDOM_BUF
+
/* Define to use libc SHA1 functions */
#undef HAVE_SHA1_IN_LIBC
Index: xsrc/external/mit/xorg-server.old/dist/os/auth.c
diff -u xsrc/external/mit/xorg-server.old/dist/os/auth.c:1.2 xsrc/external/mit/xorg-server.old/dist/os/auth.c:1.3
--- xsrc/external/mit/xorg-server.old/dist/os/auth.c:1.2 Wed Mar 8 07:18:47 2017
+++ xsrc/external/mit/xorg-server.old/dist/os/auth.c Wed Mar 8 07:44:16 2017
@@ -45,6 +45,9 @@ from The Open Group.
#ifdef WIN32
#include <X11/Xw32defs.h>
#endif
+#ifdef HAVE_LIBBSD
+#include <bsd/stdlib.h> /* for arc4random_buf() */
+#endif
struct protocol {
unsigned short name_length;
@@ -317,11 +320,15 @@ GenerateAuthorization(
void
GenerateRandomData (int len, char *buf)
{
+#ifdef HAVE_ARC4RANDOMBUF
+ arc4random_buf(buf, len);
+#else
int fd;
fd = open("/dev/urandom", O_RDONLY);
read(fd, buf, len);
close(fd);
+#endif
}
#endif /* XCSECURITY */
Index: xsrc/external/mit/xorg-server.old/include/dix-config.h
diff -u xsrc/external/mit/xorg-server.old/include/dix-config.h:1.3 xsrc/external/mit/xorg-server.old/include/dix-config.h:1.4
--- xsrc/external/mit/xorg-server.old/include/dix-config.h:1.3 Wed Mar 8 07:31:42 2017
+++ xsrc/external/mit/xorg-server.old/include/dix-config.h Wed Mar 8 07:44:16 2017
@@ -134,6 +134,9 @@
/* Build a standalone xpbproxy */
/* #undef STANDALONE_XPBPROXY */
+/* Define to 1 if you have the `bsd' library (-lbsd). */
+/* #undef HAVE_LIBBSD */
+
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
@@ -161,6 +164,9 @@
/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
/* #undef HAVE_RPCSVC_DBM_H */
+/* Define to 1 if you have the `arc4random_buf' function. */
+#define HAVE_ARC4RANDOM_BUF 1
+
/* Define to use libc SHA1 functions */
#define HAVE_SHA1_IN_LIBC 1