]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
sandboxing: allow open() of stats dir
authorPeter Palfrader <peter@palfrader.org>
Sun, 3 Jul 2016 15:47:45 +0000 (17:47 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sun, 3 Jul 2016 15:47:45 +0000 (17:47 +0200)
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 [new file with mode: 0644]
src/or/main.c

diff --git a/changes/bug19556 b/changes/bug19556
new file mode 100644 (file)
index 0000000..fb1e601
--- /dev/null
@@ -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.
index f585f0be62c5724dc5e766181812371404120abf..0562f8424259faf5d93d15caee402d09d520e734 100644 (file)
@@ -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");
   }