commit a3cc514d6b85160ee01921e2cb514049391360c3 Author: David Fifield david@bamsoftware.com Date: Mon Oct 3 18:51:09 2016 -0700
meek-client-torbrowser: set Pdeathsig=SIGTERM.
Suggested by Yawning Angel as a safeguard in addition to 125b0ca1: https://bugs.torproject.org/20030#comment:8 --- meek-client-torbrowser/linux.go | 11 +++++++++++ meek-client-torbrowser/mac.go | 6 ++++++ meek-client-torbrowser/meek-client-torbrowser.go | 1 + meek-client-torbrowser/windows.go | 6 ++++++ 4 files changed, 24 insertions(+)
diff --git a/meek-client-torbrowser/linux.go b/meek-client-torbrowser/linux.go index c95f264..ae363bd 100644 --- a/meek-client-torbrowser/linux.go +++ b/meek-client-torbrowser/linux.go @@ -5,8 +5,19 @@
package main
+import ( + "os/exec" + "syscall" +) + const ( firefoxPath = "./firefox" firefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper" profileTemplatePath = "" ) + +func osSpecificCommandSetup(cmd *exec.Cmd) { + // Extra insurance against stray child processes: send SIGTERM when this + // process terminates. Only works on Linux. + cmd.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM} +} diff --git a/meek-client-torbrowser/mac.go b/meek-client-torbrowser/mac.go index 31f57f8..7ec98d9 100644 --- a/meek-client-torbrowser/mac.go +++ b/meek-client-torbrowser/mac.go @@ -5,6 +5,8 @@
package main
+import "os/exec" + const ( // During startup of meek-client-torbrowser, the browser profile is // created and maintained under firefoxProfilePath by making a @@ -14,3 +16,7 @@ const ( firefoxProfilePath = "../../../../TorBrowser-Data/Tor/PluggableTransports/profile.meek-http-helper" profileTemplatePath = "../../Resources/TorBrowser/Tor/PluggableTransports/template-profile.meek-http-helper" ) + +func osSpecificCommandSetup(cmd *exec.Cmd) { + // nothing +} diff --git a/meek-client-torbrowser/meek-client-torbrowser.go b/meek-client-torbrowser/meek-client-torbrowser.go index 729d4a3..eea9087 100644 --- a/meek-client-torbrowser/meek-client-torbrowser.go +++ b/meek-client-torbrowser/meek-client-torbrowser.go @@ -216,6 +216,7 @@ func runFirefox() (cmd *exec.Cmd, stdout io.Reader, err error) { }
cmd = exec.Command(absFirefoxPath, "--invisible", "-no-remote", "-profile", profilePath) + osSpecificCommandSetup(cmd) cmd.Stderr = os.Stderr stdout, err = cmd.StdoutPipe() if err != nil { diff --git a/meek-client-torbrowser/windows.go b/meek-client-torbrowser/windows.go index 5d87973..3b1905e 100644 --- a/meek-client-torbrowser/windows.go +++ b/meek-client-torbrowser/windows.go @@ -5,8 +5,14 @@
package main
+import "os/exec" + const ( firefoxPath = "./firefox.exe" firefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper" profileTemplatePath = "" ) + +func osSpecificCommandSetup(cmd *exec.Cmd) { + // nothing +}
tor-commits@lists.torproject.org