Commit 8d0a1ede authored by Evan Hunt's avatar Evan Hunt

RT #20213:

- correctly use -K option in dnssec-keygen
- fix an improper free() in dnssec-revoke
- fix grammar in dnssec-settime
parent 8b5f9986
......@@ -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",
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment