[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.5.0esr-14.5-1] fixup! Bug 40933: Add tor-launcher functionality



Title: GitLab

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
    fixup! Bug 40933: Add tor-launcher functionality
    
    Bug 43326: Restrict the changes to LD_LIBRARY_PATH.
    
    We used to set LD_LIBRARY_PATH for the tor daemon before launching the
    browser, but this does not work well for some distributions, which
    link to the latest version of OpenSSL, whereas we link to the LTS.
    To avoid conflicts, we can set a custom LD_LIBRARY_PATH only for the
    tor daemon.
    

2 changed files:

Changes:

  • toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
    ... ... @@ -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
       },
    

  • toolkit/components/tor-launcher/TorProcess.sys.mjs
    ... ... @@ -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) {
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx