aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-02-23 05:57:53 +0000
committermarha <marha@users.sourceforge.net>2010-02-23 05:57:53 +0000
commit64eebb5eeb9556dab6f16757f7e836e4846b15d6 (patch)
tree7b42caece7dff6674ecbc6f1b54f94c698b40e61 /xorg-server
parent3582078999db699c45afb800cd8b78f8a04baf91 (diff)
downloadvcxsrv-64eebb5eeb9556dab6f16757f7e836e4846b15d6.tar.gz
vcxsrv-64eebb5eeb9556dab6f16757f7e836e4846b15d6.tar.bz2
vcxsrv-64eebb5eeb9556dab6f16757f7e836e4846b15d6.zip
Enabled XCSECURITY
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/os/auth.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xorg-server/os/auth.c b/xorg-server/os/auth.c
index a852e1c3b..0514d1788 100644
--- a/xorg-server/os/auth.c
+++ b/xorg-server/os/auth.c
@@ -317,11 +317,23 @@ GenerateAuthorization(
void
GenerateRandomData (int len, char *buf)
{
+#ifdef _MSC_VER
+ static HANDLE hAdvApi32;
+ static BOOLEAN (_stdcall * RtlGenRandom)(void *,unsigned long);
+
+ if (!hAdvApi32)
+ {
+ hAdvApi32=LoadLibrary("advapi32.dll");
+ RtlGenRandom=(BOOLEAN (_stdcall *)(void*,unsigned long))GetProcAddress(hAdvApi32,"SystemFunction036");
+ }
+ RtlGenRandom(buf, len);
+#else
int fd;
fd = open("/dev/urandom", O_RDONLY);
read(fd, buf, len);
close(fd);
+#endif
}
#endif /* XCSECURITY */