]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
sandbox: Allow my-consensus-* files for an authority
authorDavid Goulet <dgoulet@torproject.org>
Tue, 10 Jan 2023 14:02:13 +0000 (09:02 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 10 Jan 2023 14:02:13 +0000 (09:02 -0500)
Fixes #40729

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40729 [new file with mode: 0644]
src/app/main/main.c

diff --git a/changes/ticket40729 b/changes/ticket40729
new file mode 100644 (file)
index 0000000..1c2d43d
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (sandbox, authority):
+    - With the sandbox enabled, allow to write "my-consensus-{ns|microdesc}" and
+      to rename them as well. Fixes bug 40729; bugfix on 0.3.5.1-alpha.
index 7fb92c59db7e64cc570dc9cdeacb6712adac2e25..838e129d0431d21ffabe16289c4f07b5152aae1e 100644 (file)
@@ -924,8 +924,8 @@ sandbox_init_filter(void)
 
   if (authdir_mode(options)) {
     OPEN_DATADIR("approved-routers");
-    OPEN_CACHEDIR_SUFFIX("my-consensus-microdesc", ".tmp");
-    OPEN_CACHEDIR_SUFFIX("my-consensus-ns", ".tmp");
+    OPEN_DATADIR_SUFFIX("my-consensus-microdesc", ".tmp");
+    OPEN_DATADIR_SUFFIX("my-consensus-ns", ".tmp");
   }
 
   if (options->ServerDNSResolvConfFile)
@@ -1004,6 +1004,11 @@ sandbox_init_filter(void)
   if (options->BridgeAuthoritativeDir)
     RENAME_SUFFIX("networkstatus-bridges", ".tmp");
 
+  if (authdir_mode(options)) {
+    RENAME_SUFFIX("my-consensus-microdesc", ".tmp");
+    RENAME_SUFFIX("my-consensus-ns", ".tmp");
+  }
+
 #define STAT_DATADIR(name)                      \
   sandbox_cfg_allow_stat_filename(&cfg, get_datadir_fname(name))