diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-05-07 04:49:09 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-05-07 04:49:09 +0000 |
commit | bc51c8b074e27e576c603e054dceb8fec575c376 (patch) | |
tree | e12ed1c712aeaa3f7e82297fc6e3942b79a2cd37 | |
parent | cee7c5988c826731856336cdf8dc9bda96287a69 (diff) | |
download | tor-bc51c8b074e27e576c603e054dceb8fec575c376.tar.gz tor-bc51c8b074e27e576c603e054dceb8fec575c376.zip |
Implement --verify-config command-line option to fix bug 69.
svn:r4182
-rw-r--r-- | src/or/config.c | 2 | ||||
-rw-r--r-- | src/or/main.c | 6 | ||||
-rw-r--r-- | src/or/or.h | 1 |
3 files changed, 9 insertions, 0 deletions
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. */ |