Pier Angelo Vendrame pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser

Commits:

2 changed files:

Changes:

  • toolkit/components/tor-launcher/TorLauncherUtil.jsm
    ... ... @@ -144,9 +144,10 @@ class TorFile {
    144 144
         // Anyway, that macro is also available in AppConstants.
    
    145 145
         if (TorFile.isUserDataOutsideOfAppDir) {
    
    146 146
           if (TorLauncherUtil.isMac) {
    
    147
    -        torPath = "Contents/Resources/";
    
    147
    +        torPath = "Contents/MacOS/Tor";
    
    148
    +      } else {
    
    149
    +        torPath = "TorBrowser/Tor";
    
    148 150
           }
    
    149
    -      torPath += "TorBrowser/Tor";
    
    150 151
         } else {
    
    151 152
           torPath = "Tor";
    
    152 153
           dataDir = "Data/";
    
    ... ... @@ -154,17 +155,16 @@ class TorFile {
    154 155
     
    
    155 156
         switch (this.fileType) {
    
    156 157
           case "tor":
    
    157
    -        if (TorLauncherUtil.isMac) {
    
    158
    -          this.path = `${torPath}/tor`;
    
    159
    -        } else {
    
    160
    -          this.path =
    
    161
    -            torPath + "/tor" + (TorLauncherUtil.isWindows ? ".exe" : "");
    
    158
    +        this.path = `${torPath}/tor`;
    
    159
    +        if (TorLauncherUtil.isWindows) {
    
    160
    +          this.path += ".exe";
    
    162 161
             }
    
    163 162
             break;
    
    164 163
           case "torrc-defaults":
    
    165
    -        this.path = TorFile.isUserDataOutsideOfAppDir
    
    166
    -          ? `${torPath}/torrc-defaults`
    
    167
    -          : `${dataDir}Tor/torrc-defaults`;
    
    164
    +        this.path = TorLauncherUtil.isMac
    
    165
    +          ? "Contents/Resources/TorBrowser/Tor"
    
    166
    +          : `${dataDir}Tor`;
    
    167
    +        this.path += "/torrc-defaults";
    
    168 168
             break;
    
    169 169
           case "torrc":
    
    170 170
             this.path = `${dataDir}Tor/torrc`;
    

  • toolkit/components/tor-launcher/TorProcess.jsm
    ... ... @@ -93,27 +93,6 @@ class TorProcess {
    93 93
             this._args.push("1");
    
    94 94
           }
    
    95 95
     
    
    96
    -      // Set an environment variable that points to the Tor data directory.
    
    97
    -      // This is used by meek-client-torbrowser to find the location for
    
    98
    -      // the meek browser profile.
    
    99
    -      const environment = {
    
    100
    -        TOR_BROWSER_TOR_DATA_DIR: this._dataDir.path,
    
    101
    -      };
    
    102
    -
    
    103
    -      // On Windows, prepend the Tor program directory to PATH. This is needed
    
    104
    -      // so that pluggable transports can find OpenSSL DLLs, etc.
    
    105
    -      // See https://trac.torproject.org/projects/tor/ticket/10845
    
    106
    -      if (TorLauncherUtil.isWindows) {
    
    107
    -        let path = this._exeFile.parent.path;
    
    108
    -        const env = Cc["@mozilla.org/process/environment;1"].getService(
    
    109
    -          Ci.nsIEnvironment
    
    110
    -        );
    
    111
    -        if (env.exists("PATH")) {
    
    112
    -          path += ";" + env.get("PATH");
    
    113
    -        }
    
    114
    -        environment.PATH = path;
    
    115
    -      }
    
    116
    -
    
    117 96
           this._status = TorProcessStatus.Starting;
    
    118 97
           this._didConnectToTorControlPort = false;
    
    119 98
     
    
    ... ... @@ -131,10 +110,13 @@ class TorProcess {
    131 110
           const options = {
    
    132 111
             command: this._exeFile.path,
    
    133 112
             arguments: this._args,
    
    134
    -        environment,
    
    135
    -        environmentAppend: true,
    
    136 113
             stderr: "stdout",
    
    137 114
           };
    
    115
    +      if (TorLauncherUtil.isMac) {
    
    116
    +        // On macOS, we specify pluggable transport relative to the tor
    
    117
    +        // executable.
    
    118
    +        options.workdir = this._exeFile.parent.path;
    
    119
    +      }
    
    138 120
           this._subprocess = await Subprocess.call(options);
    
    139 121
           this._dumpStdout();
    
    140 122
           this._watchProcess();