]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make sandbox work with family id keys.
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Mar 2025 12:41:49 +0000 (08:41 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Mar 2025 12:43:47 +0000 (08:43 -0400)
Closes #41022.

Bug not in any released version of Tor.

doc/man/tor.1.txt
src/app/main/main.c

index 0b09c7741b73ac8518dcc112b760dbb369773b89..1b8625dda3d8114fe22b0069a73bdec53ddbf1d2 100644 (file)
@@ -2498,6 +2498,9 @@ is non-zero):
     But for now, relay families should configure
     both this option _and_ MyFamily, so older clients
     will still recognize the relays' family membership.
+      +
+    (Note that if the seccomp2 Sandbox feature is enabled,
+    it is not possible to change the key filenames while Tor is running.)
 
 [[Nickname]] **Nickname** __name__::
     Set the server's nickname to \'name'. Nicknames must be between 1 and 19
index 01db726f00794d0b05b456b4264669432fc98ee6..7d73e4034315e02d940d0e5052b53e91c2950399 100644 (file)
@@ -957,6 +957,17 @@ sandbox_init_filter(void)
   OPEN("/etc/hosts");
   OPEN("/proc/meminfo");
 
+  {
+    smartlist_t *family_id_files =
+      list_family_key_files(options, options->KeyDirectory);
+
+    SMARTLIST_FOREACH(family_id_files, const char *, fn,
+                      OPEN(fn));
+
+    SMARTLIST_FOREACH(family_id_files, char *, cp, tor_free(cp));
+    smartlist_free(family_id_files);
+  }
+
   if (options->BridgeAuthoritativeDir)
     OPEN_DATADIR_SUFFIX("networkstatus-bridges", ".tmp");