[PATCH xdm] Missed on arc4random() conversion.

Matthieu Herrb matthieu at herrb.eu
Tue Jan 5 12:34:12 PST 2016


Signed-off-by: Matthieu Herrb <matthieu at herrb.eu>
---
 xdm/genauth.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git xdm/genauth.c xdm/genauth.c
index 5db7315..f50be3b 100644
--- xdm/genauth.c
+++ xdm/genauth.c
@@ -408,15 +408,20 @@ GenerateAuthData (char *auth, int len)
     static int	    xdmcpAuthInited;
     long	    ldata[2];
 
-# ifdef ITIMER_REAL
+# ifndef HAVE_ARC4RANDOM
+#  ifdef ITIMER_REAL
     struct timeval  now;
 
     X_GETTIMEOFDAY (&now);
     ldata[0] = now.tv_usec;
     ldata[1] = now.tv_sec;
-# else
+#  else
     ldata[0] = time ((long *) 0);
     ldata[1] = getpid ();
+#  endif
+# else
+    ldata[0] = arc4random();
+    ldata[1] = arc4random();
 # endif
 
     longtochars (ldata[0], data+0);
-- 
2.6.4



More information about the xorg-devel mailing list