AW: [Nagios-devel] Buggy debug output from nrpe since 2.1

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

AW: [Nagios-devel] Buggy debug output from nrpe since 2.1

Post by Guest »


Hi,

> > > seed=(int)time(NULL)*311-getpid()*359+getppid()*383;
> >
> > gettimeofday(&tv);
> > sec = (int)(tv.tv_sec ^ tv.tv_sec >> (__WORDSIZE - 32)); usec =
> > (int)(tv.tv_usec ^ tv.tv_usec >> (__WORDSIZE - 32)); seed = sec ^
> > usec;

These are two tricks i will surely keep in my notes. But the primitive
srand(time(NULL)) i proposed takes place when already two other methods of
seeding failed and even a warning was issued.

SSL_init
if RAND_status is not ok
RAND_load_file(some external seedfile)
if RAND_status is still not ok
Warning!
srand(time(NULL)) or one of the more tricky srands

If someone can't live with a possibly crackable encryption he should make
precautions so he will never reach this part of the code.
But as it's just another three lines, i vote for andreas' solution.

Gerhard






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked