]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
RT #20213:
authorEvan Hunt <each@isc.org>
Fri, 4 Sep 2009 16:57:22 +0000 (16:57 +0000)
committerEvan Hunt <each@isc.org>
Fri, 4 Sep 2009 16:57:22 +0000 (16:57 +0000)
- correctly use -K option in dnssec-keygen
- fix an improper free() in dnssec-revoke
- fix grammar in dnssec-settime

bin/dnssec/dnssec-keygen.c
bin/dnssec/dnssec-revoke.c
bin/dnssec/dnssec-settime.c

index d71226720ede918af85ec40f83f457813a00fde8..affb064f4982433ce48ac2331baeac00a3d895a6 100644 (file)
@@ -29,7 +29,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-keygen.c,v 1.92 2009/09/02 23:48:01 tbox Exp $ */
+/* $Id: dnssec-keygen.c,v 1.93 2009/09/04 16:57:22 each Exp $ */
 
 /*! \file */
 
@@ -704,7 +704,8 @@ main(int argc, char **argv) {
                 * case we return failure.
                 */
                ret = dst_key_fromfile(name, dst_key_id(key), alg,
-                                      DST_TYPE_PRIVATE, NULL, mctx, &oldkey);
+                                      DST_TYPE_PRIVATE, directory,
+                                      mctx, &oldkey);
                /* do not overwrite an existing key  */
                if (ret == ISC_R_SUCCESS) {
                        dst_key_free(&oldkey);
@@ -715,7 +716,8 @@ main(int argc, char **argv) {
                if (conflict == ISC_TRUE) {
                        if (verbose > 0) {
                                isc_buffer_clear(&buf);
-                               ret = dst_key_buildfilename(key, 0, NULL, &buf);
+                               ret = dst_key_buildfilename(key, 0, directory,
+                                                           &buf);
                                fprintf(stderr,
                                        "%s: %s already exists, "
                                        "generating a new key\n",
index 634fc7112822646b53b1988d20f421a652f8d4d9..4a86d74f9ac81f8842a423b34c2105287475d944 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-revoke.c,v 1.10 2009/09/02 23:48:01 tbox Exp $ */
+/* $Id: dnssec-revoke.c,v 1.11 2009/09/04 16:57:22 each Exp $ */
 
 /*! \file */
 
@@ -96,7 +96,15 @@ main(int argc, char **argv) {
                        force = ISC_TRUE;
                        break;
                    case 'K':
-                       dir = isc_commandline_argument;
+                       /*
+                        * We don't have to copy it here, but do it to
+                        * simplify cleanup later
+                        */
+                       dir = isc_mem_strdup(mctx, isc_commandline_argument);
+                       if (dir == NULL) {
+                               fatal("Failed to allocate memory for "
+                                     "directory");
+                       }
                        break;
                    case 'r':
                        remove = ISC_TRUE;
index 90e374769a2d504e5c87db29ce4d8784cce288f8..10e972d125c2d582aa3f5248352cbcd2d4674c26 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-settime.c,v 1.10 2009/09/02 23:48:01 tbox Exp $ */
+/* $Id: dnssec-settime.c,v 1.11 2009/09/04 16:57:22 each Exp $ */
 
 /*! \file */
 
@@ -203,7 +203,7 @@ main(int argc, char **argv) {
                        directory = isc_mem_strdup(mctx,
                                                   isc_commandline_argument);
                        if (directory == NULL) {
-                               fatal("Failed to memory allocation for "
+                               fatal("Failed to allocate memory for "
                                      "directory");
                        }
                        break;