aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-20 14:58:28 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-20 14:58:28 -0400
commit268a117cdf5e58da81fd9ece925c1b963f4c1ecb (patch)
treef5b020404bb4bc2c59c0968965c05d89337564a3 /src/or
parent465982012c69e78986d421604d27afd6ecbe70f6 (diff)
downloadtor-268a117cdf5e58da81fd9ece925c1b963f4c1ecb.tar
tor-268a117cdf5e58da81fd9ece925c1b963f4c1ecb.tar.gz
sandbox: tolerate reloading with DirPortFrontPage set
Also, don't tolerate changing DirPortFrontPage. Fixes bug 12028; bugfix on 0.2.5.1-alpha.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c5
-rw-r--r--src/or/main.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index aa4c0079b..b346f6648 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3747,6 +3747,11 @@ options_transition_allowed(const or_options_t *old,
"Sandbox is active");
return -1;
}
+ if (! opt_streq(old->DirPortFrontPage, new_val->DirPortFrontPage)) {
+ *msg = tor_strdup("Can't change DirPortFrontPage"
+ " while Sandbox is active");
+ return -1;
+ }
}
return 0;
diff --git a/src/or/main.c b/src/or/main.c
index dac178ade..3d109ec78 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2848,6 +2848,11 @@ sandbox_init_filter(void)
NULL, 0
);
+ if (options->DirPortFrontPage) {
+ sandbox_cfg_allow_open_filename(&cfg,
+ tor_strdup(options->DirPortFrontPage));
+ }
+
RENAME_SUFFIX("fingerprint", ".tmp");
RENAME_SUFFIX2("keys", "secret_onion_key_ntor", ".tmp");
RENAME_SUFFIX2("keys", "secret_id_key", ".tmp");