diff options
author | cognet <cognet@FreeBSD.org> | 2012-02-29 22:35:09 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2012-02-29 22:35:09 +0000 |
commit | 8a806755a45a2f0651f1f8e24a05f1ec079233f0 (patch) | |
tree | 3d4790fa599f1026ec191f7cbb1ffde35317d5ef /usr.bin/csup | |
parent | b4f09913ec3ff4da44a45c36830f1d26c6df9dd3 (diff) | |
download | FreeBSD-src-8a806755a45a2f0651f1f8e24a05f1ec079233f0.zip FreeBSD-src-8a806755a45a2f0651f1f8e24a05f1ec079233f0.tar.gz |
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
Diffstat (limited to 'usr.bin/csup')
-rw-r--r-- | usr.bin/csup/auth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/csup/auth.c b/usr.bin/csup/auth.c index c90d719..1704eba 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) { |