[tor-commits] [tor/master] Allow reloading torrc and writing to router-stability

nickm at torproject.org nickm at torproject.org
Thu Apr 17 03:48:07 UTC 2014


commit 18f7f49a8c08a38c15de4b8e6413ed2ae0968639
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Apr 16 15:54:45 2014 -0400

    Allow reloading torrc and writing to router-stability
---
 src/or/main.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/or/main.c b/src/or/main.c
index cdbb2db..4770b7e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2728,6 +2728,7 @@ sandbox_init_filter(void)
 {
   const or_options_t *options = get_options();
   sandbox_cfg_t *cfg = sandbox_cfg_new();
+  int i;
 
   sandbox_cfg_allow_openat_filename(&cfg,
       get_datadir_fname("cached-status"));
@@ -2774,6 +2775,12 @@ sandbox_init_filter(void)
   else
     sandbox_cfg_allow_open_filename(&cfg, tor_strdup("/etc/resolv.conf"));
 
+  for (i = 0; i < 2; ++i) {
+    if (get_torrc_fname(i)) {
+      sandbox_cfg_allow_open_filename(&cfg, tor_strdup(get_torrc_fname(i)));
+    }
+  }
+
 #define RENAME_SUFFIX(name, suffix)        \
   sandbox_cfg_allow_rename(&cfg,           \
       get_datadir_fname(name suffix),      \
@@ -2827,6 +2834,8 @@ sandbox_init_filter(void)
         get_datadir_fname("fingerprint.tmp"),
         get_datadir_fname("hashed-fingerprint"),
         get_datadir_fname("hashed-fingerprint.tmp"),
+        get_datadir_fname("router-stability"),
+        get_datadir_fname("router-stability.tmp"),
         tor_strdup("/etc/resolv.conf"),
         NULL, 0
     );
@@ -2838,6 +2847,7 @@ sandbox_init_filter(void)
     RENAME_SUFFIX2("keys", "secret_onion_key", ".tmp");
     RENAME_SUFFIX2("keys", "secret_onion_key.old", ".tmp");
     RENAME_SUFFIX("hashed-fingerprint", ".tmp");
+    RENAME_SUFFIX("router-stability", ".tmp");
 
     sandbox_cfg_allow_rename(&cfg,
              get_datadir_fname2("keys", "secret_onion_key"),





More information about the tor-commits mailing list