Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
nagios-nrpe
nrpe-more_random.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nrpe-more_random.patch of Package nagios-nrpe
Index: src/utils.c =================================================================== --- src/utils.c.orig +++ src/utils.c @@ -90,17 +90,13 @@ void randomize_buffer(char *buffer,int b ends and the rest of the buffer (padded randomly) starts. ***************************************************************/ - /* try to get seed value from /dev/urandom, as its a better source of entropy */ - fp=fopen("/dev/urandom","r"); - if(fp!=NULL){ - seed=fgetc(fp); - fclose(fp); - } - - /* else fallback to using the current time as the seed */ - else - seed=(int)time(NULL); - + /*************************************************************** + The randomness, produced by the original version, is just + between 0 and 255. The randomness generated by the line below + produces more randomness and does not reduce the amount of + entropy that the linux kernel thinks it has. + ***************************************************************/ + seed=(int)time(NULL)*311-getpid()*359+getppid()*383; srand(seed); for(x=0;x<buffer_size;x++) buffer[x]=(int)'0'+(int)(72.0*rand()/(RAND_MAX+1.0));
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor