]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2880. [cleanup] Make the output of dnssec-keygen and dnssec-revoke
authorMark Andrews <marka@isc.org>
Thu, 6 May 2010 05:31:19 +0000 (05:31 +0000)
committerMark Andrews <marka@isc.org>
Thu, 6 May 2010 05:31:19 +0000 (05:31 +0000)
                        consistent. [RT #21078]

CHANGES
bin/dnssec/dnssec-revoke.c

diff --git a/CHANGES b/CHANGES
index 21ce9b2a008120645612eb4ca23d4df256e1ac7f..37fd484e0b1a08fa61af00709788194633239a1d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2880.  [cleanup]       Make the output of dnssec-keygen and dnssec-revoke
+                       consistent. [RT #21078]
+
 2879.  [contrib]       DLZ bdbhpt driver fails to close correct cursor.
                        [RT #21106]
 
index e3683c85fe58f8415ac9137176c6a4211a407758..7041e94afbfef01bd5aacbd7abe091b6ba2d6627 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dnssec-revoke.c,v 1.20 2009/12/18 23:49:02 tbox Exp $ */
+/* $Id: dnssec-revoke.c,v 1.21 2010/05/06 05:31:19 marka Exp $ */
 
 /*! \file */
 
@@ -161,6 +161,10 @@ main(int argc, char **argv) {
                        fatal("cannot process filename %s: %s",
                              argv[isc_commandline_index],
                              isc_result_totext(result));
+               if (strcmp(dir, ".") == 0) {
+                       isc_mem_free(mctx, dir);
+                       dir = NULL;
+               }
        }
 
        if (ectx == NULL)
@@ -224,10 +228,8 @@ main(int argc, char **argv) {
                              isc_result_totext(result));
                }
 
-               printf("%s\n", newname);
-
                isc_buffer_clear(&buf);
-               dst_key_buildfilename(key, DST_TYPE_PRIVATE, dir, &buf);
+               dst_key_buildfilename(key, 0, dir, &buf);
                printf("%s\n", newname);
 
                /*
@@ -259,7 +261,8 @@ cleanup:
        cleanup_entropy(&ectx);
        if (verbose > 10)
                isc_mem_stats(mctx, stdout);
-       isc_mem_free(mctx, dir);
+       if (dir != NULL)
+               isc_mem_free(mctx, dir);
        isc_mem_destroy(&mctx);
 
        return (0);