2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Don't print the "lacking /dev/random" message if the user specifically

wanted to use the keyboard for whatever reason.
This commit is contained in:
Brian Wellington 2000-06-22 19:16:33 +00:00
parent ad4cf977d0
commit 2492d62e44

View File

@ -38,7 +38,8 @@ extern int verbose;
extern const char *program; extern const char *program;
static isc_entropysource_t *source = NULL; static isc_entropysource_t *source = NULL;
isc_keyboard_t kbd; static isc_keyboard_t kbd;
static isc_boolean_t wantkeyboard = ISC_FALSE;
void void
fatal(const char *format, ...) { fatal(const char *format, ...) {
@ -181,9 +182,11 @@ kbdstart(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
if (!blocking) if (!blocking)
return (ISC_R_NOENTROPY); return (ISC_R_NOENTROPY);
if (first) { if (first) {
fprintf(stderr, "You must use the keyboard to create entropy, " if (!wantkeyboard) {
"since your system is lacking\n"); fprintf(stderr, "You must use the keyboard to create "
fprintf(stderr, "/dev/random\n\n"); "entropy, since your system is lacking\n");
fprintf(stderr, "/dev/random\n\n");
}
first = ISC_FALSE; first = ISC_FALSE;
} }
fprintf(stderr, "start typing:\n"); fprintf(stderr, "start typing:\n");
@ -255,6 +258,8 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
if (result == ISC_R_SUCCESS) if (result == ISC_R_SUCCESS)
return; return;
} }
else
wantkeyboard = ISC_TRUE;
result = isc_entropy_createcallbacksource(*ectx, kbdstart, result = isc_entropy_createcallbacksource(*ectx, kbdstart,
kbdget, kbdstop, kbdget, kbdstop,
&kbd, &source); &kbd, &source);