Pier Angelo Vendrame pushed to branch tor-browser-128.5.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits:
-
6756b736
by Pier Angelo Vendrame at 2024-12-02T18:33:34+01:00
2 changed files:
- toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
- toolkit/components/tor-launcher/TorProcess.sys.mjs
Changes:
... | ... | @@ -5,6 +5,8 @@ |
5 | 5 | * Tor Launcher Util JS Module
|
6 | 6 | *************************************************************************/
|
7 | 7 | |
8 | +import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
|
9 | + |
|
8 | 10 | const lazy = {};
|
9 | 11 | |
10 | 12 | ChromeUtils.defineESModuleGetters(lazy, {
|
... | ... | @@ -335,6 +337,13 @@ export const TorLauncherUtil = Object.freeze({ |
335 | 337 | return Services.appinfo.OS === "Android";
|
336 | 338 | },
|
337 | 339 | |
340 | + get isLinux() {
|
|
341 | + // Use AppConstants for Linux rather then appinfo because we are sure it
|
|
342 | + // will catch also various Unix flavors for which unofficial ports might
|
|
343 | + // exist (which should work as Linux, as far as we know).
|
|
344 | + return AppConstants.platform === "linux";
|
|
345 | + },
|
|
346 | + |
|
338 | 347 | get isMac() {
|
339 | 348 | return Services.appinfo.OS === "Darwin";
|
340 | 349 | },
|
... | ... | @@ -125,6 +125,16 @@ export class TorProcess { |
125 | 125 | stderr: "stdout",
|
126 | 126 | workdir: lazy.TorLauncherUtil.getTorFile("pt-startup-dir", false).path,
|
127 | 127 | };
|
128 | + if (lazy.TorLauncherUtil.isLinux) {
|
|
129 | + let ldLibPath = Services.env.get("LD_LIBRARY_PATH") ?? "";
|
|
130 | + if (ldLibPath) {
|
|
131 | + ldLibPath = ":" + ldLibPath;
|
|
132 | + }
|
|
133 | + options.environment = {
|
|
134 | + LD_LIBRARY_PATH: this.#exeFile.parent.path + ldLibPath,
|
|
135 | + };
|
|
136 | + options.environmentAppend = true;
|
|
137 | + }
|
|
128 | 138 | this.#subprocess = await Subprocess.call(options);
|
129 | 139 | this.#status = TorProcessStatus.Running;
|
130 | 140 | } catch (e) {
|