diff -uprk.orig bind-9.2.4rc5.orig/bin/rndc/rndc-confgen.c bind-9.2.4rc5/bin/rndc/rndc-confgen.c --- bind-9.2.4rc5.orig/bin/rndc/rndc-confgen.c 2004-03-09 09:09:26 +0300 +++ bind-9.2.4rc5/bin/rndc/rndc-confgen.c 2004-06-30 17:13:39 +0400 @@ -45,7 +45,7 @@ #include "util.h" -#define DEFAULT_KEYLENGTH 128 /* Bits. */ +#define DEFAULT_KEYLENGTH 256 /* Bits. */ #define DEFAULT_KEYNAME "rndc-key" #define DEFAULT_SERVER "127.0.0.1" #define DEFAULT_PORT 953 @@ -134,6 +134,7 @@ main(int argc, char **argv) { char *chrootdir = NULL; char *user = NULL; isc_boolean_t keyonly = ISC_FALSE; + isc_boolean_t gen_key_only = ISC_FALSE; int len; keydef = keyfile = RNDC_KEYFILE; @@ -149,11 +150,14 @@ main(int argc, char **argv) { port = DEFAULT_PORT; while ((ch = isc_commandline_parse(argc, argv, - "ab:c:hk:Mmp:r:s:t:u:Vy")) != -1) { + "Aab:c:hk:Mmp:r:s:t:u:Vy")) != -1) { switch (ch) { case 'a': keyonly = ISC_TRUE; break; + case 'A': + gen_key_only = ISC_TRUE; + break; case 'b': keysize = strtol(isc_commandline_argument, &p, 10); if (*p != '\0' || keysize < 0) @@ -262,7 +266,11 @@ main(int argc, char **argv) { isc_entropy_detach(&ectx); dst_lib_destroy(); - if (keyonly) { + if (gen_key_only) { + printf("%.*s\n", + (int)isc_buffer_usedlength(&key_txtbuffer), + (char *)isc_buffer_base(&key_txtbuffer)); + } else if (keyonly) { write_key_file(keyfile, chrootdir == NULL ? user : NULL, keyname, &key_txtbuffer);