mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Implementing --allow-missing-torrc CLI option.
This commit is contained in:
parent
12dc55f487
commit
86cfc64d45
6
changes/ticket10060
Normal file
6
changes/ticket10060
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
o Minor features:
|
||||||
|
- Adding --allow-missing-torrc commandline option
|
||||||
|
that allows Tor to run if configuration file specified
|
||||||
|
by -f is not available, but default torrc is.
|
||||||
|
Implements ticket 10060.
|
||||||
|
|
@ -45,6 +45,10 @@ COMMAND-LINE OPTIONS
|
|||||||
options. (Default: $HOME/.torrc, or @CONFDIR@/torrc if that file is not
|
options. (Default: $HOME/.torrc, or @CONFDIR@/torrc if that file is not
|
||||||
found)
|
found)
|
||||||
|
|
||||||
|
[[opt-allow-missing-torrc]] **--allow-missing-torrc**::
|
||||||
|
Do not require that configuration file specified by **-f** exist if
|
||||||
|
default torrc can be accessed.
|
||||||
|
|
||||||
[[opt-defaults-torrc]] **--defaults-torrc** __FILE__::
|
[[opt-defaults-torrc]] **--defaults-torrc** __FILE__::
|
||||||
Specify a file in which to find default values for Tor options. The
|
Specify a file in which to find default values for Tor options. The
|
||||||
contents of this file are overridden by those in the regular
|
contents of this file are overridden by those in the regular
|
||||||
|
@ -1816,6 +1816,7 @@ static const struct {
|
|||||||
int takes_argument;
|
int takes_argument;
|
||||||
} CMDLINE_ONLY_OPTIONS[] = {
|
} CMDLINE_ONLY_OPTIONS[] = {
|
||||||
{ "-f", 1 },
|
{ "-f", 1 },
|
||||||
|
{ "--allow-missing-torrc", 0 },
|
||||||
{ "--defaults-torrc", 1 },
|
{ "--defaults-torrc", 1 },
|
||||||
{ "--hash-password", 1 },
|
{ "--hash-password", 1 },
|
||||||
{ "--dump-config", 1 },
|
{ "--dump-config", 1 },
|
||||||
@ -4016,8 +4017,13 @@ options_init_from_torrc(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
cf_defaults = load_torrc_from_disk(cmdline_only_options, 1);
|
cf_defaults = load_torrc_from_disk(cmdline_only_options, 1);
|
||||||
cf = load_torrc_from_disk(cmdline_only_options, 0);
|
cf = load_torrc_from_disk(cmdline_only_options, 0);
|
||||||
if (!cf)
|
if (!cf) {
|
||||||
goto err;
|
if (config_line_find(cmdline_only_options, "--allow-missing-torrc")) {
|
||||||
|
cf = tor_strdup("");
|
||||||
|
} else {
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = options_init_from_string(cf_defaults, cf, command, command_arg,
|
retval = options_init_from_string(cf_defaults, cf, command, command_arg,
|
||||||
|
Loading…
Reference in New Issue
Block a user