summary refs log tree commit diff
path: root/pkgs/tools/security/tor
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2016-05-31 23:28:03 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2016-05-31 23:37:20 +0200
commit961164a8a7986041e5c1022888c9a6f4925135ff (patch)
tree541c8fc9971a5c9a4d7adf6bd9b5255182a2d40d /pkgs/tools/security/tor
parentd5d4606190fc951b421e2bbd47585b99c46bf6bf (diff)
torbrowser: explicitly set paths to torrc-defaults and tor
This patch fixes an issue introduced by b897f825942b63ab790cad9ed66c8a79cbb3fc2d
where the bundled tor fails to run.

The error message claims that it cannot communicate with tor, but what actually
happens is that tor never runs at all, because it is invoked with a non-existent
rc file.  Specifying an absolute path to the torrc-defaults file fixes the
problem.  For good measure, we specify an absolute path to the tor executable
itself as well; we want as little autodetection logic as possible.

Note that users of torbrowser *must* remove the existing `~/.torbrowser4` folder
for this to take effect, otherwise torbrowser will continue to use extension
data from the previous release (this is why some existing users were able to
successfully use the new torbrowser version, see
https://github.com/NixOS/nixpkgs/pull/15854).
Diffstat (limited to 'pkgs/tools/security/tor')
-rw-r--r--pkgs/tools/security/tor/torbrowser.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/tools/security/tor/torbrowser.nix b/pkgs/tools/security/tor/torbrowser.nix
index 2103f9ccad91a..ae9b4918aef53 100644
--- a/pkgs/tools/security/tor/torbrowser.nix
+++ b/pkgs/tools/security/tor/torbrowser.nix
@@ -59,6 +59,10 @@ stdenv.mkDerivation rec {
       mkdir -p \$HOME && cp -R $out/share/tor-browser/Browser/TorBrowser/Data \$HOME/ && chmod -R +w \$HOME
       echo "pref(\"extensions.torlauncher.tordatadir_path\", \"\$HOME/Data/Tor/\");" >> \
         ~/Data/Browser/profile.default/preferences/extension-overrides.js
+      echo "pref(\"extensions.torlauncher.torrc-defaults_path\", \"\$HOME/Data/Tor/torrc-defaults\");" >> \
+        ~/Data/Browser/profile.default/preferences/extension-overrides.js
+      echo "pref(\"extensions.torlauncher.tor_path\", \"$out/share/tor-browser/Browser/TorBrowser/Tor/tor\");" >> \
+        ~/Data/Browser/profile.default/preferences/extension-overrides.js
     fi
     export FONTCONFIG_PATH=\$HOME/Data/fontconfig
     export LD_LIBRARY_PATH=${libPath}:$out/share/tor-browser/Browser/TorBrowser/Tor