]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2594. [func] Have rndc warn if using its default configuration file
authorJeremy Reed <jreed@isc.org>
Mon, 4 May 2009 17:38:56 +0000 (17:38 +0000)
committerJeremy Reed <jreed@isc.org>
Mon, 4 May 2009 17:38:56 +0000 (17:38 +0000)
                       when the key file also exists. [RT #19424]

CHANGES
bin/rndc/rndc.c

diff --git a/CHANGES b/CHANGES
index e37afbbe1e6c2f96a5fbc4c13f7e52c47ff32b58..f7b1437e276a4df8ae1e807f445bbd6535e9a80d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2594.  [func]          Have rndc warn if using its default configuration file
+                       when the key file also exists. [RT #19424]
+
 2593.  [bug]           Improve a corner source of SERVFAILs [RT #19632]
 
 2592.  [bug]           Treat "any" as a type in nsupdate. [RT #19455]
index 1069c7ebd3ef7f1a0e16a61dbd58c518662c86df..532ce901f730150237d3162cab9f9da2a1586c30 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc.c,v 1.124 2009/01/17 23:47:42 tbox Exp $ */
+/* $Id: rndc.c,v 1.125 2009/05/04 17:38:56 jreed Exp $ */
 
 /*! \file */
 
@@ -79,6 +79,7 @@ static unsigned char databuf[2048];
 static isccc_ccmsg_t ccmsg;
 static isccc_region_t secret;
 static isc_boolean_t failed = ISC_FALSE;
+static isc_boolean_t c_flag = ISC_FALSE;
 static isc_mem_t *mctx;
 static int sends, recvs, connects;
 static char *command;
@@ -455,6 +456,10 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
                        fatal("neither %s nor %s was found",
                              admin_conffile, admin_keyfile);
                key_only = ISC_TRUE;
+       } else if (! c_flag && isc_file_exists(admin_keyfile)) {
+               fprintf(stderr, "WARNING: key file (%s) exists, but using "
+                       "default configuration file (%s)\n",
+                       admin_keyfile, admin_conffile);
        }
 
        DO("create parser", cfg_parser_create(mctx, log, pctxp));
@@ -709,6 +714,7 @@ main(int argc, char **argv) {
 
                case 'c':
                        admin_conffile = isc_commandline_argument;
+                       c_flag = ISC_TRUE;
                        break;
 
                case 'k':