[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-128.2.0esr-14.0-1] Bug 42773: Replace ~ with the original home.

morgan (@morgan) git at gitlab.torproject.org
Wed Sep 4 16:15:23 UTC 2024



morgan pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
0aacf3d5 by Pier Angelo Vendrame at 2024-09-04T16:11:17+00:00
Bug 42773: Replace ~ with the original home.

In Bug 93141, Mozilla started sending users to their home when they type
~ in the URL bar.
On Linux, we change $HOME for various reason, therefore you would be
redirected to the spoofed home directory when typing ~.
So, we check if the original home directory is known, and use that,
instead.

- - - - -


1 changed file:

- docshell/base/URIFixup.sys.mjs


Changes:

=====================================
docshell/base/URIFixup.sys.mjs
=====================================
@@ -934,6 +934,10 @@ function fileURIFixup(uriString) {
   } else {
     // UNIX: Check if it starts with "/" or "~".
     attemptFixup = /^[~/]/.test(uriString);
+    const originalHome = Services.env.get("BB_ORIGINAL_HOME");
+    if (originalHome && (uriString === "~" || uriString.startsWith("~/"))) {
+      path = originalHome + path.substring(1);
+    }
   }
   if (attemptFixup) {
     try {



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

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/0aacf3d51f9bc2e2dc6f52194a7a7d2d03e56cdd
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/20240904/1395f8bc/attachment-0001.htm>


More information about the tbb-commits mailing list