summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2016-06-30 09:37:23 +0000
committerAndrea Shepard <andrea@torproject.org>2016-06-30 09:37:23 +0000
commit13a16e001164581b687dae2d3377f77eedb701ff (patch)
treecd0fc894e7e7b44bef41a77a6e2360669337e06a /src/or/routerparse.c
parent34d9dabed18452aed6ba0d983673c8366c1b64a2 (diff)
downloadtor-13a16e001164581b687dae2d3377f77eedb701ff.tar.gz
tor-13a16e001164581b687dae2d3377f77eedb701ff.zip
Also check if the sandbox is configured as well as if it's active; sandbox_init() runs rather late in the startup process
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index def6373357..875bb605b0 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1073,7 +1073,11 @@ dump_desc(const char *desc, const char *type)
DESC_DUMP_BASE_FILENAME ".%s", digest_sha256_hex);
debugfile = get_datadir_fname2(DESC_DUMP_DATADIR_SUBDIR, debugfile_base);
- if (!sandbox_is_active()) {
+ /*
+ * Check if the sandbox is active or will become active; see comment
+ * below at the log message for why.
+ */
+ if (!(sandbox_is_active() || get_options()->Sandbox)) {
if (len <= get_options()->MaxUnparseableDescSizeToLog) {
if (!dump_desc_fifo_bump_hash(digest_sha256)) {
/* Create the directory if needed */
@@ -1128,7 +1132,7 @@ dump_desc(const char *desc, const char *type)
log_info(LD_DIR,
"Unable to parse descriptor of type %s with hash %s and "
"length %lu. Descriptor not dumped because the sandbox is "
- "active",
+ "configured",
type, digest_sha256_hex, (unsigned long)len);
}
@@ -6001,7 +6005,12 @@ rend_parse_client_keys(strmap_t *parsed_clients, const char *ckstr)
void
routerparse_init(void)
{
- if (!(sandbox_is_active())) {
+ /*
+ * Check both if the sandbox is active and whether it's configured; no
+ * point in loading all that if we won't be able to use it after the
+ * sandbox becomes active.
+ */
+ if (!(sandbox_is_active() || get_options()->Sandbox)) {
dump_desc_init();
}
}