[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #13037 [Tor]: compile time option to not read config from sysconfdir
#13037: compile time option to not read config from sysconfdir
------------------------+----------------------------------------------
Reporter: weasel | Owner: rl1987
Type: defect | Status: needs_review
Priority: normal | Milestone: Tor: 0.2.6.x-final
Component: Tor | Version: Tor: unspecified
Resolution: | Keywords: easy, 026-triaged-1, nickm-patch
Actual Points: | Parent ID:
Points: |
------------------------+----------------------------------------------
Comment (by weasel):
Looking at your ticket13037 branch,
- it seems good in general. I tested it and I think it did what I
wanted and expected.
- it has unrelated 9396005428c40cf7ef9f1e6ae1d725f3155391f5 (Remove a
check for an ancient bad dirserver fingerprint) without a changelog entry.
- src/or/config.c:6446 write_configuration_file():
that tor_assert(fname) is now useless.
- src/or/contro.c:1440: getinfo_helper_misc():
Don't like double calling of far away function.
proposal:
{{{
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1439,11 +1439,13 @@ 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")) {
- if (get_torrc_fname(0))
- *answer = tor_strdup(get_torrc_fname(0));
+ const char* a;
+ if ((a = get_torrc_fname(0)))
+ *answer = tor_strdup(a);
} else if (!strcmp(question, "config-defaults-file")) {
- if (get_torrc_fname(1))
- *answer = tor_strdup(get_torrc_fname(1));
+ const char* a;
+ if ((a = get_torrc_fname(1)))
+ *answer = tor_strdup(a);
} else if (!strcmp(question, "config-text")) {
*answer = options_dump(get_options(), OPTIONS_DUMP_MINIMAL);
} else if (!strcmp(question, "info/names")) {
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13037#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs