mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Implement --verify-config command-line option to fix bug 69.
svn:r4182
This commit is contained in:
parent
cee7c5988c
commit
bc51c8b074
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user