]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
894. [bug] A message intended to warn when the keyboard was being
authorDavid Lawrence <source@isc.org>
Fri, 8 Jun 2001 22:07:16 +0000 (22:07 +0000)
committerDavid Lawrence <source@isc.org>
Fri, 8 Jun 2001 22:07:16 +0000 (22:07 +0000)
used because of the lack of a suitable random device
was not being printed.

wantkeyboard was always being set to true just before setting up the keyboard
callback, rather than only being set to true if PATH_RANDOMDEV was undefined
or not able to be opened.

CHANGES
bin/dnssec/dnssectool.c

diff --git a/CHANGES b/CHANGES
index 0b7aec4c979819aba425b8f34de56a8154d9af0d..991d94f68c264594511c17ee4003c0fdca16ce2c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
 
+ 894.  [bug]           A message intended to warn when the keyboard was being
+                       used because of the lack of a suitable random device
+                       was not being printed.
+
  893.  [func]          Removed isc_file_test() and added isc_file_exists()
                        for the basic functionality that was being added
                        with isc_file_test().
index e86fbce7afd683d7f1c840d184626ed6242a9d68..f368e8ddcb02e903f1e7aaacd634d8482fbc67ff 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssectool.c,v 1.28 2001/03/31 02:12:24 bwelling Exp $ */
+/* $Id: dnssectool.c,v 1.29 2001/06/08 22:07:16 tale Exp $ */
 
 #include <config.h>
 
@@ -275,23 +275,26 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
        result = isc_entropy_create(mctx, ectx);
        if (result != ISC_R_SUCCESS)
                fatal("could not create entropy object");
-       if (randomfile != NULL && strcasecmp(randomfile, "keyboard") != 0) {
+
+#ifdef PATH_RANDOMDEV
+       if (randomfile == NULL) {
+               result = isc_entropy_createfilesource(*ectx, PATH_RANDOMDEV);
+               if (result == ISC_R_SUCCESS)
+                       return;
+       }
+#endif
+
+       if (randomfile != NULL && strcasecmp(randomfile, "keyboard") == 0) {
+               wantkeyboard = ISC_TRUE;
+               randomfile = NULL;
+       }
+               
+       if (randomfile != NULL) {
                result = isc_entropy_createfilesource(*ectx, randomfile);
                if (result != ISC_R_SUCCESS)
                        fatal("could not open randomdev %s: %s", randomfile,
                              isc_result_totext(result));
-       }
-       else {
-#ifdef PATH_RANDOMDEV
-               if (randomfile == NULL) {
-                       result = isc_entropy_createfilesource(*ectx,
-                                                             PATH_RANDOMDEV);
-                       if (result == ISC_R_SUCCESS)
-                               return;
-               }
-               else
-#endif
-                       wantkeyboard = ISC_TRUE;
+       } else {
                result = isc_entropy_createcallbacksource(*ectx, kbdstart,
                                                          kbdget, kbdstop,
                                                          &kbd, &source);