[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [fog/master] the tor_pt_state_location env var now has '/fog' to it to avoid clobbering similar transports launched directly by tor instead of fog. See ticket #12613



commit 729d47bbeed5915d2f70013bcc9817ef19c83a08
Author: Quinn Jarrell <qjarrell@xxxxxxxxxxxxxxx>
Date:   Wed Jul 16 15:04:06 2014 -0400

    the tor_pt_state_location env var now has '/fog' to it to avoid clobbering similar transports launched directly by tor instead of fog. See ticket #12613
---
 fog-client/fog-client    |    3 +++
 fog-server/fog-server.go |    3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/fog-client/fog-client b/fog-client/fog-client
index 9b2e7ef..c59efc3 100755
--- a/fog-client/fog-client
+++ b/fog-client/fog-client
@@ -49,6 +49,9 @@ def pt_child_env(managed_ver, env=os.environ):
     exempt = ['TOR_PT_STATE_LOCATION']
     cur_env = [(k, v) for k, v in env.iteritems()
                       if not k.startswith('TOR_PT_') or k in exempt]
+    if 'TOR_PT_STATE_LOCATION' in env:
+        prev_pt_state_location = env['TOR_PT_STATE_LOCATION']
+        cur_env.append(('TOR_PT_STATE_LOCATION', os.path.join(prev_pt_state_location, 'fog')))
     cur_env.append(('TOR_PT_MANAGED_TRANSPORT_VER', ','.join(managed_ver)))
     return cur_env
 
diff --git a/fog-server/fog-server.go b/fog-server/fog-server.go
index bb34219..cf77a6a 100644
--- a/fog-server/fog-server.go
+++ b/fog-server/fog-server.go
@@ -10,6 +10,7 @@ import (
 	"os"
 	"os/exec"
 	"os/signal"
+	"path"
 	"strings"
 	"sync"
 	"syscall"
@@ -199,7 +200,7 @@ func startProcesses(connectBackAddr net.Addr, plugins []ServerTransportPlugin) (
 		cmd := exec.Command(plugin.Command[0], plugin.Command[1:]...)
 		cmd.Env = []string{
 			"TOR_PT_MANAGED_TRANSPORT_VER=1",
-			"TOR_PT_STATE_LOCATION=" + os.Getenv("TOR_PT_STATE_LOCATION"),
+			"TOR_PT_STATE_LOCATION=" + path.Join(os.Getenv("TOR_PT_STATE_LOCATION"), "fog"),
 			"TOR_PT_EXTENDED_SERVER_PORT=",
 			"TOR_PT_ORPORT=" + bindAddr.String(),
 			"TOR_PT_SERVER_TRANSPORTS=" + plugin.MethodName,



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits