sandbox: tolerate reloading with DirPortFrontPage set

Also, don't tolerate changing DirPortFrontPage.

Fixes bug 12028; bugfix on 0.2.5.1-alpha.
This commit is contained in:
Nick Mathewson 2014-05-20 14:58:28 -04:00
parent 465982012c
commit 268a117cdf
3 changed files with 15 additions and 0 deletions

5
changes/bug12028 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes (linux syscall sandbox):
- When running with DirPortFrontPage and Sandbox both enabled, reload
the DirPortFrontPage correctly when restarting. Fixes bug 12028;
bugfix on 0.2.5.1-alpha.

View File

@ -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;

View File

@ -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");