瀏覽代碼

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.
Peter Palfrader 10 年之前
父節點
當前提交
2c4e78d95b
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 6 0
      changes/bug19556
  2. 1 0
      src/or/main.c

+ 6 - 0
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.

+ 1 - 0
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");
   }