Bug 250584

Summary: security/tor: Support different fibs for multiple instances
Product: Ports & Packages Reporter: Thomas Steen Rasmussen / Tykling <thomas>
Component: Individual Port(s)Assignee: Yuri Victorovich <yuri>
Status: New ---    
Severity: Affects Only Me CC: vvd
Priority: --- Flags: bugzilla: maintainer-feedback? (yuri)
Version: Latest   
Hardware: Any   
OS: Any   

Description Thomas Steen Rasmussen / Tykling 2020-10-24 19:10:49 UTC
Hello Tor friends,

I am using the multi instance support introduced in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207129 to run more than one Tor instance. I want to run some instances with a different routing table, so:


tor_instances="foo bar"
tor_foo_fib=1
tor_bar_fib=2


This currently doesn't work because tor_fib is not set for the so-called "slave" instances (that wording should be changed btw).

The following 1-line patch makes it work, although you may wish to implement it in another way  :)


# git diff tor /usr/local/etc/rc.d/tor 
diff --git a/tor b/usr/local/etc/rc.d/tor
index 57eb6c8..1ca4a70 100755
--- a/tor
+++ b/usr/local/etc/rc.d/tor
@@ -78,6 +78,7 @@ if [ -n "${instance}" ]; then
     tor_conf=${tor_conf}@${inst_name}
     tor_pidfile=${tor_pidfile}@${inst_name}
     tor_datadir=${tor_datadir}/instance@${inst_name}
+    tor_fib=$(eval echo \$tor_${inst_name}_fib)
   fi
   if ! [ -r ${tor_conf} ]; then
     warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"


I hope we can get this into the port so I don't have to run with a local patch. Thank you!
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2020-10-24 19:26:22 UTC
> tor_fib=$(eval echo \$tor_${inst_name}_fib)
eval tor_fib="\${tor_${inst_name}_fib}"
Comment 2 Thomas Steen Rasmussen / Tykling 2020-11-03 21:23:07 UTC
Hello :)

That works too - I just tested it.

/Thomas