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

richard (@richard) git at gitlab.torproject.org
Fri Sep 15 18:32:41 UTC 2023



richard pushed to branch tor-browser-115.2.1esr-13.0-1 at The Tor Project / Applications / Tor Browser


Commits:
a4ff8505 by Pier Angelo Vendrame at 2023-09-15T18:31:31+00:00
fixup! Bug 40933: Add tor-launcher functionality

Bug 42102: Fix checkPort in TorProcess

- - - - -


2 changed files:

- toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
- toolkit/components/tor-launcher/TorProcess.sys.mjs


Changes:

=====================================
toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
=====================================
@@ -8,7 +8,7 @@
 const lazy = {};
 
 ChromeUtils.defineESModuleGetters(lazy, {
-  FileUtils: "resource://gre/modules/FileUtils.sys.jsm",
+  FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
 });
 
 const kPropBundleURI = "chrome://torbutton/locale/torlauncher.properties";
@@ -565,7 +565,7 @@ export const TorLauncherUtil = Object.freeze({
     }
 
     if (useIPC === undefined) {
-      socksPortInfo.useIPC =
+      useIPC =
         !this.isWindows &&
         Services.prefs.getBoolPref(
           "extensions.torlauncher.socks_port_use_ipc",
@@ -574,7 +574,7 @@ export const TorLauncherUtil = Object.freeze({
     }
 
     // Fill in missing SOCKS info from prefs.
-    if (socksPortInfo.useIPC) {
+    if (useIPC) {
       if (!socksPortInfo.ipcFile) {
         socksPortInfo.ipcFile = TorLauncherUtil.getTorFile("socks_ipc", false);
       }
@@ -611,7 +611,7 @@ export const TorLauncherUtil = Object.freeze({
       return;
     }
 
-    if (socksPortInfo.useIPC) {
+    if (socksPortInfo.ipcFile) {
       const fph = Services.io
         .getProtocolHandler("file")
         .QueryInterface(Ci.nsIFileProtocolHandler);


=====================================
toolkit/components/tor-launcher/TorProcess.sys.mjs
=====================================
@@ -49,9 +49,7 @@ export class TorProcess {
 
     const checkPort = port =>
       port === undefined ||
-      (Number.isInteger(controlSettings.port) &&
-        controlSettings.port > 0 &&
-        controlSettings.port < 65535);
+      (Number.isInteger(port) && port > 0 && port < 65535);
     if (!checkPort(controlSettings?.port)) {
       throw new Error("Invalid control port");
     }



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/a4ff850581f027a084bd86e6f6662e37fb1d70fd

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/a4ff850581f027a084bd86e6f6662e37fb1d70fd
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230915/06fb8448/attachment-0001.htm>


More information about the tbb-commits mailing list