Skip to content
Snippets Groups Projects
Commit 73e416fe authored by Kathleen Brade's avatar Kathleen Brade
Browse files

Bug 19646: Mac OS: wrong location for meek browser profile

On OSX, use the TOR_BROWSER_TOR_DATA_DIR environment variable value
(if available) to determine the location of the meek browser profile.
This fixes a problem where meek-client-torbrowser attempted to use a
path under /Applications/TorBrowser-Data, to which regular users may
not have write access.
parent 1f36df65
Branches
Tags
No related merge requests found
......@@ -13,6 +13,7 @@ import (
const (
firefoxPath = "./firefox"
firefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper"
torDataDirFirefoxProfilePath = ""
profileTemplatePath = ""
)
......
......
......@@ -9,10 +9,15 @@ import "os/exec"
const (
// During startup of meek-client-torbrowser, the browser profile is
// created and maintained under firefoxProfilePath by making a
// recursive copy of everything under profileTemplatePath.
// https://bugs.torproject.org/18904
// created and maintained under a meek-specific directory by making a
// recursive copy of everything under profileTemplatePath (see
// https://bugs.torproject.org/18904).
// If the TOR_BROWSER_TOR_DATA_DIR env var is set, the path for the
// meek-specific profile directory is constructed by appending
// torDataDirFirefoxProfilePath to TOR_BROWSER_TOR_DATA_DIR. Otherwise,
// firefoxProfilePath (a relative path) is used.
firefoxPath = "../firefox"
torDataDirFirefoxProfilePath = "PluggableTransports/profile.meek-http-helper"
firefoxProfilePath = "../../../../TorBrowser-Data/Tor/PluggableTransports/profile.meek-http-helper"
profileTemplatePath = "../../Resources/TorBrowser/Tor/PluggableTransports/template-profile.meek-http-helper"
)
......
......
......@@ -206,10 +206,15 @@ func runFirefox() (cmd *exec.Cmd, stdout io.Reader, err error) {
return
}
var profilePath string
var torDataDir = os.Getenv("TOR_BROWSER_TOR_DATA_DIR")
if torDataDir != "" && torDataDirFirefoxProfilePath != "" {
profilePath = filepath.Join(torDataDir, torDataDirFirefoxProfilePath)
} else {
profilePath, err = filepath.Abs(firefoxProfilePath)
if err != nil {
return
}
}
err = prepareBrowserProfile(profilePath)
if err != nil {
return
......
......
......@@ -10,6 +10,7 @@ import "os/exec"
const (
firefoxPath = "./firefox.exe"
firefoxProfilePath = "TorBrowser/Data/Browser/profile.meek-http-helper"
torDataDirFirefoxProfilePath = ""
profileTemplatePath = ""
)
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment