summaryrefslogtreecommitdiff
path: root/os/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/auth.c')
-rw-r--r--os/auth.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/os/auth.c b/os/auth.c
index b2a145f89..dab4f60bd 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -42,9 +42,6 @@ from The Open Group.
# include "dixstruct.h"
# include <sys/types.h>
# include <sys/stat.h>
-#ifdef XCSECURITY
-# include "securitysrv.h"
-#endif
#ifdef WIN32
#include <X11/Xw32defs.h>
#endif
@@ -89,14 +86,6 @@ static struct protocol protocols[] = {
#endif
},
#endif
-#ifdef XCSECURITY
-{ (unsigned short) XSecurityAuthorizationNameLen,
- XSecurityAuthorizationName,
- NULL, AuthSecurityCheck, NULL,
- NULL, NULL, NULL,
- NULL
-},
-#endif
};
# define NUM_AUTHORIZATION (sizeof (protocols) /\
@@ -325,6 +314,20 @@ GenerateAuthorization(
return -1;
}
+#ifdef HAVE_URANDOM
+
+void
+GenerateRandomData (int len, char *buf)
+{
+ int fd;
+
+ fd = open("/dev/urandom", O_RDONLY);
+ read(fd, buf, len);
+ close(fd);
+}
+
+#else /* !HAVE_URANDOM */
+
/* A random number generator that is more unpredictable
than that shipped with some systems.
This code is taken from the C standard. */
@@ -362,4 +365,6 @@ GenerateRandomData (int len, char *buf)
/* XXX add getrusage, popen("ps -ale") */
}
+#endif /* HAVE_URANDOM */
+
#endif /* XCSECURITY */