aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-20 15:21:27 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-20 15:21:48 -0400
commitc21377e7bcc70d2a456409225d8b2d91990a14cd (patch)
treed8d55aa4d85929f1631fc487e9ed2e7991d2dd3b /src/or
parent29f2f7ce9af19f22187098fad6d002a6e5a46479 (diff)
downloadtor-c21377e7bcc70d2a456409225d8b2d91990a14cd.tar
tor-c21377e7bcc70d2a456409225d8b2d91990a14cd.tar.gz
sandbox: support logfile rotation
Fixes bug 12032; bugfix on 0.2.5.1-alpha
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c12
-rw-r--r--src/or/main.c9
2 files changed, 14 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c
index b346f6648..0f7b1d2a2 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1143,13 +1143,11 @@ options_act_reversible(const or_options_t *old_options, char **msg)
if (!running_tor)
goto commit;
- if (!sandbox_is_active()) {
- mark_logs_temp(); /* Close current logs once new logs are open. */
- logs_marked = 1;
- if (options_init_logs(options, 0)<0) { /* Configure the tor_log(s) */
- *msg = tor_strdup("Failed to init Log options. See logs for details.");
- goto rollback;
- }
+ mark_logs_temp(); /* Close current logs once new logs are open. */
+ logs_marked = 1;
+ if (options_init_logs(options, 0)<0) { /* Configure the tor_log(s) */
+ *msg = tor_strdup("Failed to init Log options. See logs for details.");
+ goto rollback;
}
commit:
diff --git a/src/or/main.c b/src/or/main.c
index 3d109ec78..7d114d9f6 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2822,6 +2822,15 @@ sandbox_init_filter(void)
NULL, 0
);
+ {
+ smartlist_t *logfiles = smartlist_new();
+ tor_log_get_logfile_names(logfiles);
+ SMARTLIST_FOREACH(logfiles, char *, logfile_name, {
+ sandbox_cfg_allow_open_filename(&cfg, logfile_name); /* steals reference */
+ });
+ smartlist_free(logfiles);
+ }
+
// orport
if (server_mode(get_options())) {
sandbox_cfg_allow_open_filename_array(&cfg,