]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
sandbox: tolerate reloading with DirPortFrontPage set
authorNick Mathewson <nickm@torproject.org>
Tue, 20 May 2014 18:58:28 +0000 (14:58 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 20 May 2014 18:58:28 +0000 (14:58 -0400)
Also, don't tolerate changing DirPortFrontPage.

Fixes bug 12028; bugfix on 0.2.5.1-alpha.

changes/bug12028 [new file with mode: 0644]
src/or/config.c
src/or/main.c

diff --git a/changes/bug12028 b/changes/bug12028
new file mode 100644 (file)
index 0000000..f88d4e5
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (linux syscall sandbox):
+    - When running with DirPortFrontPage and Sandbox both enabled, reload
+      the DirPortFrontPage correctly when restarting. Fixes bug 12028;
+      bugfix on 0.2.5.1-alpha.
+
index aa4c0079bf0463fcaaca114125602eac4670be7a..b346f6648e3b045c40164c6005e9c4615717b1be 100644 (file)
@@ -3747,6 +3747,11 @@ options_transition_allowed(const or_options_t *old,
                         "Sandbox is active");
       return -1;
     }
+    if (! opt_streq(old->DirPortFrontPage, new_val->DirPortFrontPage)) {
+      *msg = tor_strdup("Can't change DirPortFrontPage"
+                        " while Sandbox is active");
+      return -1;
+    }
   }
 
   return 0;
index dac178ade8096b410575cf9f108d4a8192b07390..3d109ec78c09a145626c969c01556946d7e4d9b9 100644 (file)
@@ -2848,6 +2848,11 @@ sandbox_init_filter(void)
         NULL, 0
     );
 
+    if (options->DirPortFrontPage) {
+      sandbox_cfg_allow_open_filename(&cfg,
+                                      tor_strdup(options->DirPortFrontPage));
+    }
+
     RENAME_SUFFIX("fingerprint", ".tmp");
     RENAME_SUFFIX2("keys", "secret_onion_key_ntor", ".tmp");
     RENAME_SUFFIX2("keys", "secret_id_key", ".tmp");