diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-11-19 18:10:46 -0500 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-11-19 18:10:46 -0500 |
commit | 2d17f47cc7d6b174857617d31ad1b437d8e97d94 (patch) | |
tree | 90fb5d8d63fa0c121eef355affce79d1d84a2bbe /os/auth.c | |
parent | 60be452c2e88342f92a76ba5ec7d90b5b0211aaf (diff) | |
parent | ea9c63e93b9bb731796e8a8de2d127e6cc720076 (diff) |
Merge branch 'master' into XACE-SELINUX
Conflicts:
hw/xnest/Pixmap.c
include/dix.h
Diffstat (limited to 'os/auth.c')
-rw-r--r-- | os/auth.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -314,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. */ @@ -351,4 +365,6 @@ GenerateRandomData (int len, char *buf) /* XXX add getrusage, popen("ps -ale") */ } +#endif /* HAVE_URANDOM */ + #endif /* XCSECURITY */ |