[tor-commits] [tor/maint-0.2.8] sandboxing: allow open() of stats dir
nickm at torproject.org
nickm at torproject.org
Tue Jul 5 16:39:48 UTC 2016
commit 2c4e78d95b2bc42c43ba09163e9c2d0744d9ac7b
Author: Peter Palfrader <peter at palfrader.org>
Date: Sun Jul 3 17:47:45 2016 +0200
sandboxing: allow open() of stats dir
When sandboxing is enabled, we could not write any stats to disk.
check_or_create_data_subdir("stats"), which prepares the private stats
directory, calls check_private_dir(), which also opens and not just stats() the
directory. Therefore, we need to also allow open() for the stats dir in our
sandboxing setup.
---
changes/bug19556 | 6 ++++++
src/or/main.c | 1 +
2 files changed, 7 insertions(+)
diff --git a/changes/bug19556 b/changes/bug19556
new file mode 100644
index 0000000..fb1e601
--- /dev/null
+++ b/changes/bug19556
@@ -0,0 +1,6 @@
+ o Minor bugfixes (sandboxing):
+ - When sandboxing is enabled, we could not write any stats to
+ disk. check_or_create_data_subdir("stats"), which prepares the
+ private stats directory, calls check_private_dir(), which also
+ opens and not just stats() the directory. Therefore, we need to
+ also allow open() for the stats dir in our sandboxing setup.
diff --git a/src/or/main.c b/src/or/main.c
index f585f0b..0562f84 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -3568,6 +3568,7 @@ sandbox_init_filter(void)
get_datadir_fname2("keys", "secret_onion_key_ntor.old"));
STAT_DATADIR("keys");
+ OPEN_DATADIR("stats");
STAT_DATADIR("stats");
STAT_DATADIR2("stats", "dirreq-stats");
}
More information about the tor-commits
mailing list