#include "knot/dnssec/context.h"
-#define ERROR(msg, ...) { fprintf(stderr, "Error: " msg, ##__VA_ARGS__); fflush(stderr); }
+#define ERROR(msg, ...) { fprintf(stderr, "Error: " msg, ##__VA_ARGS__); fflush(stderr); }
+#define WARNING(msg, ...) { fprintf(stderr, "Warning: " msg, ##__VA_ARGS__); fflush(stderr); }
typedef struct {
knot_time_print_t format;
" (default %s)\n"
" -C, --confdb <dir> Use a binary configuration database directory.\n"
" (default %s)\n"
- " -d, --dir <path> Use specified KASP database path and default configuration.\n"
+ " -D, --dir <path> Use specified KASP database path and default configuration.\n"
" -t, --tsig <name> [alg] Generate a TSIG key.\n"
" -l, --list List all zones that have at least one key in KASP database.\n"
" -x, --mono Don't color the output.\n"
struct option opts[] = {
{ "config", required_argument, NULL, 'c' },
{ "confdb", required_argument, NULL, 'C' },
- { "dir", required_argument, NULL, 'd' },
+ { "dir", required_argument, NULL, 'D' },
{ "tsig", required_argument, NULL, 't' },
{ "brief", no_argument, NULL, 'b' },
{ "list", no_argument, NULL, 'l' },
list_params.color = isatty(STDOUT_FILENO);
int opt = 0, parm = 0;
- while ((opt = getopt_long(argc, argv, "hVd:c:C:t:lbxX", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "hVd:D:c:C:t:lbxX", opts, NULL)) != -1) {
switch (opt) {
case 'h':
print_help();
print_version(PROGRAM_NAME);
return EXIT_SUCCESS;
case 'd':
+ WARNING("keymgr -d is deprecated, use -D option instead\n");
+ // FALLTHROUGH
+ case 'D':
CHECK_CONF_UNINIT
if (!init_conf(NULL) || !init_conf_blank(optarg)) {
return EXIT_FAILURE;
init_conf(NULL) && init_confile(CONF_DEFAULT_FILE)) {
// initialized conf from default confile
} else {
- ERROR("couldn't initialize configuration, please provide -c, -C, or -d option\n");
+ ERROR("couldn't initialize configuration, please provide -c, -C, or -D option\n");
return EXIT_FAILURE;
}
}
import random
def check_keys(server, zone_name, expect_keys):
- cmd = Popen([dnstest.params.keymgr_bin, "-d", server.dir + "/keys", zone_name, "list"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
+ cmd = Popen([dnstest.params.keymgr_bin, "-D", server.dir + "/keys", zone_name, "list"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
(stdout, stderr) = cmd.communicate()
lines = len(stdout.splitlines())
if lines != expect_keys:
import random
def check_keys(server, zone_name, expect_keys):
- cmd = Popen([dnstest.params.keymgr_bin, "-d", server.dir + "/keys", zone_name, "list"], \
+ cmd = Popen([dnstest.params.keymgr_bin, "-D", server.dir + "/keys", zone_name, "list"], \
stdout=PIPE, stderr=PIPE, universal_newlines=True)
(stdout, stderr) = cmd.communicate()
lines = len(stdout.splitlines())