From bc51c8b074e27e576c603e054dceb8fec575c376 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 7 May 2005 04:49:09 +0000 Subject: [PATCH] Implement --verify-config command-line option to fix bug 69. svn:r4182 --- src/or/config.c | 2 ++ src/or/main.c | 6 ++++++ src/or/or.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/or/config.c b/src/or/config.c index 7fc718902d..5ec19d15fc 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1799,6 +1799,8 @@ init_from_config(int argc, char **argv) newoptions->command = CMD_HASH_PASSWORD; newoptions->command_arg = tor_strdup( (i < argc-1) ? argv[i+1] : ""); ++i; + } else if (!strcmp(argv[i],"--verify-config")) { + newoptions->command = CMD_VERIFY_CONFIG; } } diff --git a/src/or/main.c b/src/or/main.c index b7faecdfbf..821ff210d5 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1409,6 +1409,9 @@ void nt_service_main(void) case CMD_HASH_PASSWORD: do_hash_password(); break; + case CMD_VERIFY_CONFIG: + printf("Configuration was valid\n"); + break; default: log_fn(LOG_ERR, "Illegal command number %d: internal error.", get_options()->command); } @@ -1594,6 +1597,9 @@ int tor_main(int argc, char *argv[]) { case CMD_HASH_PASSWORD: do_hash_password(); break; + case CMD_VERIFY_CONFIG: + printf("Configuration was valid\n"); + break; default: log_fn(LOG_ERR, "Illegal command number %d: internal error.", get_options()->command); diff --git a/src/or/or.h b/src/or/or.h index bc3e8c1a72..62f73987ba 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -954,6 +954,7 @@ typedef struct { /** What should the tor process actually do? */ enum { CMD_RUN_TOR=0, CMD_LIST_FINGERPRINT, CMD_HASH_PASSWORD, + CMD_VERIFY_CONFIG, } command; const char *command_arg; /**< Argument for command-line option. */