summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2013-11-03 18:53:41 +0200
committerNick Mathewson <nickm@torproject.org>2013-11-07 14:26:05 -0500
commit86cfc64d4565187250c8b92d25c24a1c5a0bec0d (patch)
treebcb364729cf3a57a1edbe57d2bb2f23511248b12 /src/or/config.c
parent12dc55f4878d16bfc3fb6789b31494d47df7ccec (diff)
downloadtor-86cfc64d4565187250c8b92d25c24a1c5a0bec0d.tar.gz
tor-86cfc64d4565187250c8b92d25c24a1c5a0bec0d.zip
Implementing --allow-missing-torrc CLI option.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 5fc32153e9..57d6dcdc0f 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1816,6 +1816,7 @@ static const struct {
int takes_argument;
} CMDLINE_ONLY_OPTIONS[] = {
{ "-f", 1 },
+ { "--allow-missing-torrc", 0 },
{ "--defaults-torrc", 1 },
{ "--hash-password", 1 },
{ "--dump-config", 1 },
@@ -4016,8 +4017,13 @@ options_init_from_torrc(int argc, char **argv)
} else {
cf_defaults = load_torrc_from_disk(cmdline_only_options, 1);
cf = load_torrc_from_disk(cmdline_only_options, 0);
- if (!cf)
- goto err;
+ if (!cf) {
+ 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,