mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 07:40:00 -04:00
remove flags from source types. It was never used, and probably shouldn't be there.
This commit is contained in:
parent
fd316ab4f9
commit
7685c082c8
8 changed files with 15 additions and 23 deletions
|
|
@ -174,11 +174,11 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
|
|||
if (result != ISC_R_SUCCESS)
|
||||
fatal("could not create entropy object");
|
||||
if (randomfile != NULL) {
|
||||
result = isc_entropy_createfilesource(*ectx, randomfile, 0);
|
||||
result = isc_entropy_createfilesource(*ectx, randomfile);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
return;
|
||||
}
|
||||
result = isc_entropy_createfilesource(*ectx, "/dev/random", 0);
|
||||
result = isc_entropy_createfilesource(*ectx, "/dev/random");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("No randomfile specified, and /dev/random not present.");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1556,7 +1556,7 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) {
|
|||
server->entropy = NULL;
|
||||
CHECKFATAL(isc_entropy_create(ns_g_mctx, &server->entropy),
|
||||
"initializing entropy pool");
|
||||
(void) isc_entropy_createfilesource(server->entropy, "/dev/random", 0);
|
||||
(void)isc_entropy_createfilesource(server->entropy, "/dev/random");
|
||||
|
||||
CHECKFATAL(dst_lib_init(ns_g_mctx, server->entropy, 0),
|
||||
"initializing DST");
|
||||
|
|
|
|||
|
|
@ -241,8 +241,8 @@ main(void) {
|
|||
dns_result_register();
|
||||
|
||||
isc_entropy_create(mctx, &ectx);
|
||||
isc_entropy_createfilesource(ectx, "/dev/random", 0);
|
||||
isc_entropy_createfilesource(ectx, "randomfile", 0);
|
||||
isc_entropy_createfilesource(ectx, "/dev/random");
|
||||
isc_entropy_createfilesource(ectx, "randomfile");
|
||||
dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING|ISC_ENTROPY_GOODONLY);
|
||||
|
||||
dns_fixedname_init(&fname);
|
||||
|
|
|
|||
|
|
@ -366,8 +366,8 @@ t1(void) {
|
|||
t_result(T_UNRESOLVED);
|
||||
return;
|
||||
}
|
||||
isc_entropy_createfilesource(ectx, "/dev/random", 0);
|
||||
result = isc_entropy_createfilesource(ectx, "randomfile", 0);
|
||||
isc_entropy_createfilesource(ectx, "/dev/random");
|
||||
result = isc_entropy_createfilesource(ectx, "randomfile");
|
||||
if (isc_result != ISC_R_SUCCESS) {
|
||||
t_info("isc_entropy_create failed %d\n",
|
||||
isc_result_totext(isc_result));
|
||||
|
|
@ -840,8 +840,8 @@ t2_vfy(char **av) {
|
|||
isc_result_totext(isc_result));
|
||||
return(T_UNRESOLVED);
|
||||
}
|
||||
isc_entropy_createfilesource(ectx, "/dev/random", 0);
|
||||
result = isc_entropy_createfilesource(ectx, "randomfile", 0);
|
||||
isc_entropy_createfilesource(ectx, "/dev/random");
|
||||
result = isc_entropy_createfilesource(ectx, "randomfile");
|
||||
if (isc_result != ISC_R_SUCCESS) {
|
||||
t_info("isc_entropy_create failed %d\n",
|
||||
isc_result_totext(isc_result));
|
||||
|
|
|
|||
|
|
@ -71,15 +71,13 @@ main(int argc, char **argv) {
|
|||
isc_entropy_stats(ent, stderr);
|
||||
|
||||
#if 1
|
||||
flags = 0;
|
||||
CHECK("isc_entropy_createfilesource() 1",
|
||||
isc_entropy_createfilesource(ent, "/dev/random", flags));
|
||||
isc_entropy_createfilesource(ent, "/dev/random"));
|
||||
CHECK("isc_entropy_createfilesource() 2",
|
||||
isc_entropy_createfilesource(ent, "/dev/random", flags));
|
||||
isc_entropy_createfilesource(ent, "/dev/random"));
|
||||
#else
|
||||
flags = 0;
|
||||
CHECK("isc_entropy_createfilesource() 3",
|
||||
isc_entropy_createfilesource(ent, "/tmp/foo", flags));
|
||||
isc_entropy_createfilesource(ent, "/tmp/foo"));
|
||||
#endif
|
||||
|
||||
fprintf(stderr,
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ main(int argc, char *argv[]) {
|
|||
ectx = NULL;
|
||||
RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
|
||||
|
||||
result = isc_entropy_createfilesource(ectx, "/dev/random", 0);
|
||||
result = isc_entropy_createfilesource(ectx, "/dev/random");
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr,
|
||||
"%s only runs when /dev/random is available.\n",
|
||||
|
|
|
|||
|
|
@ -136,8 +136,7 @@ isc_entropy_detach(isc_entropy_t **entp);
|
|||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname,
|
||||
unsigned int flags);
|
||||
isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname);
|
||||
/*
|
||||
* Create a new entropy source from a file.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ struct isc_entropysource {
|
|||
isc_uint32_t magic;
|
||||
unsigned int type;
|
||||
isc_entropy_t *ent;
|
||||
unsigned int flags; /* flags */
|
||||
isc_uint32_t total; /* entropy from this source */
|
||||
ISC_LINK(isc_entropysource_t) link;
|
||||
char name[32];
|
||||
|
|
@ -854,9 +853,7 @@ make_nonblock(int fd) {
|
|||
}
|
||||
|
||||
isc_result_t
|
||||
isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname,
|
||||
unsigned int flags)
|
||||
{
|
||||
isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
|
||||
int fd;
|
||||
isc_result_t ret;
|
||||
isc_entropysource_t *source;
|
||||
|
|
@ -894,7 +891,6 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname,
|
|||
source->magic = SOURCE_MAGIC;
|
||||
source->type = ENTROPY_SOURCETYPE_FILE;
|
||||
source->ent = ent;
|
||||
source->flags = flags;
|
||||
source->total = 0;
|
||||
memset(source->name, 0, sizeof(source->name));
|
||||
ISC_LINK_INIT(source, link);
|
||||
|
|
@ -988,7 +984,6 @@ isc_entropy_createcallbacksource(isc_entropy_t *ent,
|
|||
source->magic = SOURCE_MAGIC;
|
||||
source->type = ENTROPY_SOURCETYPE_CALLBACK;
|
||||
source->ent = ent;
|
||||
source->flags = 0;
|
||||
source->total = 0;
|
||||
memset(source->name, 0, sizeof(source->name));
|
||||
ISC_LINK_INIT(source, link);
|
||||
|
|
|
|||
Loading…
Reference in a new issue