From d8139ed7ed4679488111c15914324465a40ccf7c Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Wed, 29 Feb 2012 22:35:09 +0000 Subject: [PATCH] Use srandom() to init the PRNG, not srand(), since we use random(). This is harmless because srandom() is called somewhere else, with time(NULL) as a seed, but this is more correct. Obtained from: https://bitbucket.org/mux/csup Pointyhat to: not mux, somebody else MFC after: 1 week --- usr.bin/csup/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/csup/auth.c b/usr.bin/csup/auth.c index c90d71930fdd..1704eba53b23 100644 --- a/usr.bin/csup/auth.c +++ b/usr.bin/csup/auth.c @@ -293,7 +293,7 @@ auth_makechallenge(struct config *config, char *challenge) gettimeofday(&tv, NULL); pid = getpid(); ppid = getppid(); - srand(tv.tv_usec ^ tv.tv_sec ^ pid); + srandom(tv.tv_usec ^ tv.tv_sec ^ pid); addrlen = sizeof(laddr); error = getsockname(config->socket, (struct sockaddr *)&laddr, &addrlen); if (error < 0) {