aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-27 22:25:52 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-27 22:25:52 -0500
commit230422b955e1708f27f42cdd25e8b21a33fdd3dd (patch)
tree84031114094c820debd2681aea3b4e5c6f786273 /src/or/control.c
parent73436a1d6fdbe411a0ee869ee570f4a1239cfa81 (diff)
downloadtor-230422b955e1708f27f42cdd25e8b21a33fdd3dd.tar.gz
tor-230422b955e1708f27f42cdd25e8b21a33fdd3dd.zip
Support for a defaults torrc file.
This will mainly help distributors by giving a way to set system or package defaults that a user can override, and that a later package can replace. No promises about the particular future location or semantics for this: we will probably want to tweak it some before 0.2.3.x-rc The file is searched for in CONFDIR/torrc-defaults , which can be overridden with the "--defaults-torrc" option on the command line.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 19904ddeb9..8d924b44f1 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -883,7 +883,7 @@ handle_control_loadconf(control_connection_t *conn, uint32_t len,
const char *msg = NULL;
(void) len;
- retval = options_init_from_string(body, CMD_RUN_TOR, NULL, &errstring);
+ retval = options_init_from_string(NULL, body, CMD_RUN_TOR, NULL, &errstring);
if (retval != SETOPT_OK)
log_warn(LD_CONTROL,
@@ -1378,7 +1378,9 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
if (!strcmp(question, "version")) {
*answer = tor_strdup(get_version());
} else if (!strcmp(question, "config-file")) {
- *answer = tor_strdup(get_torrc_fname());
+ *answer = tor_strdup(get_torrc_fname(0));
+ } else if (!strcmp(question, "config-defaults-file")) {
+ *answer = tor_strdup(get_torrc_fname(1));
} else if (!strcmp(question, "config-text")) {
*answer = options_dump(get_options(), 1);
} else if (!strcmp(question, "info/names")) {