1 |
commit: 077bcb531439cd1eec06af0bf6754fbd2bc99500 |
2 |
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 18 10:55:09 2019 +0000 |
4 |
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 18 10:55:09 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=077bcb53 |
7 |
|
8 |
www-client/torbrowser: misc cleanup to code, update fx patchset |
9 |
|
10 |
Package-Manager: Portage-2.3.63, Repoman-2.3.12 |
11 |
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org> |
12 |
|
13 |
www-client/torbrowser/Manifest | 2 +- |
14 |
www-client/torbrowser/files/99torbrowser.example | 20 + |
15 |
www-client/torbrowser/files/profile.cfg | 42 ++ |
16 |
...nge_the_default_Firefox_profile_directory.patch | 425 +++++++++++++++++++++ |
17 |
...0.5.0-Do_not_store_data_in_the_app_bundle.patch | 189 +++++++++ |
18 |
.../torbrowser-60.5.0-nss-fixup-warnings.patch | 25 ++ |
19 |
www-client/torbrowser/files/torbrowser-lto.patch | 32 -- |
20 |
.../torbrowser/files/torbrowser-profiledir.patch | 44 --- |
21 |
.../files/torbrowser-rust_missing_docs.patch | 21 - |
22 |
...build => torbrowser-60.6.1.8.0.8.1.1-r1.ebuild} | 117 +++--- |
23 |
10 files changed, 761 insertions(+), 156 deletions(-) |
24 |
|
25 |
diff --git a/www-client/torbrowser/Manifest b/www-client/torbrowser/Manifest |
26 |
index 3a1fff6..4f1ad0f 100644 |
27 |
--- a/www-client/torbrowser/Manifest |
28 |
+++ b/www-client/torbrowser/Manifest |
29 |
@@ -1,4 +1,4 @@ |
30 |
-DIST firefox-60.6-patches-01.tar.xz 14548 BLAKE2B 412059a6db015fff0985e637768426f877b33bb6b649c54f1292780b9d871f8fe9bf8e6b150ec36ab3647b4501fa6aec821c089a5d6fa861402f05e948f1a9d4 SHA512 b97da7a7b65bbf53cb6b9f48fc6c07a32cefa9d4b4a79ce57df047f941f5269e21bf09fa56a5f31bbf757ed2d76f8a1fe01d2306c92d20cab979e0a21f895e64 |
31 |
+DIST firefox-60.6-patches-05.tar.xz 35980 BLAKE2B eea4ed2061f36b85bfa0677434f3acf478d9a58ed3130c2b2cab4dc78613e16ff481cc063d71525fc16b01be3cfe17a4a5dcd60c5070205246eb8b2b78387393 SHA512 3a591d68f5911c6547de24e73390478eb389f467a49f4010cd8c295569a09d878ffa2db4a072fe118c1195d1f0acf0adbb7540de14c367cb4cec522b4f1e4b05 |
32 |
DIST tor-browser-60.6.1esr-8.0-1-build1.tar.gz 386384151 BLAKE2B 18c9a07296317a0e62e40939c9b839850069836f9d489910fc364e1e2929a3218d3a2fc8a521a59d8971b925a09e0c29820a964bc326b0143480f2839b9f72cf SHA512 9a39ed63494cd2be4952312d8160884f2fa35211f3ea54fc2e9dcc737236102938d8c17b3a112420d847b7c7e98d0f33f210afb3d0fd979e21f7e23769372b4b |
33 |
DIST tor-browser-linux32-8.0.8_en-US.tar.xz 76761628 BLAKE2B 0c21f3c5718da9fcfe8961a59cd98be495411ea85200294f1918aa9c27af25428e18d7b8a52bab1c27360e6ded221ea981554b7f4130ccd646bc9edb53039f43 SHA512 ebd2b93bdaf87d34cb03ecc2d0811d376a3942de9ea84b6f049358127e91c76aaef4bdd7fcaa9467660e907f9ee5d3fd239f80d7a1667fea2e9b5fbb80355d42 |
34 |
DIST tor-browser-linux64-8.0.8_en-US.tar.xz 75228720 BLAKE2B 2e368225ca44868b700f1a6c8cb7a0f8f532adbca0f38d998741f5a8e24b76553ab861416724d0101b5b30a8bb305b96d308bfc6315619be4489a8f98ebc979a SHA512 a046d56280b24c3a524b894b94ecacd876d27f732bcc1744a5b194684b1477fcb468e6978a20bee456242708e7f9a4e58a7e82e58f31ed3b84f652689cec546e |
35 |
|
36 |
diff --git a/www-client/torbrowser/files/99torbrowser.example b/www-client/torbrowser/files/99torbrowser.example |
37 |
new file mode 100644 |
38 |
index 0000000..e138b30 |
39 |
--- /dev/null |
40 |
+++ b/www-client/torbrowser/files/99torbrowser.example |
41 |
@@ -0,0 +1,20 @@ |
42 |
+# /etc/env.d/99torbrowser |
43 |
+# |
44 |
+# The Tor ControlPort password should be given inside double quotes, inside |
45 |
+# single quotes, i.e. if the ControlPort password is “secret” (without |
46 |
+# curly quotes) then we must set the environment variable *exactly* like |
47 |
+# this: |
48 |
+# TOR_CONTROL_PASSWD='"secret"' |
49 |
+# Yes, the variable MUST be double-quoted, then single-quoted, exactly as |
50 |
+# shown. This is used by TorButton to authenticate to Tor's ControlPort, and |
51 |
+# is necessary for using TB with a system-installed Tor |
52 |
+ |
53 |
+#TOR_SOCKS_HOST=127.0.0.1 |
54 |
+#TOR_SOCKS_PORT=9150 |
55 |
+#TOR_SOCKS_IPC_PATH=/var/run/tor/socks |
56 |
+ |
57 |
+#TOR_CONTROL_HOST=127.0.0.1 |
58 |
+#TOR_CONTROL_PORT=9151 |
59 |
+#TOR_CONTROL_PASSWD='"secret"' |
60 |
+#TOR_CONTROL_COOKIE_AUTH_FILE=/var/run/tor/control.authcookie |
61 |
+#TOR_CONTROL_IPC_PATH=/var/run/tor/control |
62 |
|
63 |
diff --git a/www-client/torbrowser/files/profile.cfg b/www-client/torbrowser/files/profile.cfg |
64 |
new file mode 100644 |
65 |
index 0000000..d14309a |
66 |
--- /dev/null |
67 |
+++ b/www-client/torbrowser/files/profile.cfg |
68 |
@@ -0,0 +1,42 @@ |
69 |
+// |
70 |
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components; |
71 |
+Cu.import("resource://gre/modules/Services.jsm"); |
72 |
+Cu.import("resource://gre/modules/FileUtils.jsm"); |
73 |
+ |
74 |
+var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile); |
75 |
+var certDBFile = profileDir.clone(); |
76 |
+certDBFile.append("cert8.db") |
77 |
+// If cert8.db isn't there, it's a new profile |
78 |
+if (!certDBFile.exists()) { |
79 |
+ var defaultProfileDir = Services.dirsvc.get("GreD", Ci.nsIFile); |
80 |
+ defaultProfileDir.append("defaults"); |
81 |
+ defaultProfileDir.append("profile"); |
82 |
+ try { |
83 |
+ copyDir(defaultProfileDir, profileDir); |
84 |
+ } catch (e) { |
85 |
+ Components.utils.reportError(e); |
86 |
+ } |
87 |
+} |
88 |
+ |
89 |
+function copyDir(aOriginal, aDestination) { |
90 |
+ var enumerator = aOriginal.directoryEntries; |
91 |
+ while (enumerator.hasMoreElements()) { |
92 |
+ var file = enumerator.getNext().QueryInterface(Components.interfaces.nsIFile); |
93 |
+ if (file.isDirectory()) { |
94 |
+ var subdir = aDestination.clone(); |
95 |
+ subdir.append(file.leafName); |
96 |
+ try { |
97 |
+ subdir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY); |
98 |
+ copyDir(file, subdir); |
99 |
+ } catch (e) { |
100 |
+ Components.utils.reportError(e); |
101 |
+ } |
102 |
+ } else { |
103 |
+ try { |
104 |
+ file.copyTo(aDestination, null); |
105 |
+ } catch (e) { |
106 |
+ Components.utils.reportError(e); |
107 |
+ } |
108 |
+ } |
109 |
+ } |
110 |
+} |
111 |
|
112 |
diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch b/www-client/torbrowser/files/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch |
113 |
new file mode 100644 |
114 |
index 0000000..3559402 |
115 |
--- /dev/null |
116 |
+++ b/www-client/torbrowser/files/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch |
117 |
@@ -0,0 +1,425 @@ |
118 |
+From e5b0afd7fee16e7f755095b8b85296fe401fb04d Mon Sep 17 00:00:00 2001 |
119 |
+From: Poncho <poncho@××××××.ch> |
120 |
+Date: Wed, 30 Jan 2019 09:55:48 +0100 |
121 |
+Subject: [PATCH 2/4] Revert "Bug 9173: Change the default Firefox profile |
122 |
+ directory to be TBB-relative." |
123 |
+ |
124 |
+This reverts commit b82691c60b6a3ade6939b0f68f28de1e3c120292. |
125 |
+--- |
126 |
+ toolkit/xre/nsXREDirProvider.cpp | 147 +++++++++++++++++++------ |
127 |
+ toolkit/xre/nsXREDirProvider.h | 12 +- |
128 |
+ xpcom/io/nsAppFileLocationProvider.cpp | 97 ++++++++++------ |
129 |
+ 3 files changed, 181 insertions(+), 75 deletions(-) |
130 |
+ |
131 |
+diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp |
132 |
+index dbbaffd2a15f..00ee37ce9b5f 100644 |
133 |
+--- a/toolkit/xre/nsXREDirProvider.cpp |
134 |
++++ b/toolkit/xre/nsXREDirProvider.cpp |
135 |
+@@ -32,7 +32,6 @@ |
136 |
+ #include "nsArrayEnumerator.h" |
137 |
+ #include "nsEnumeratorUtils.h" |
138 |
+ #include "nsReadableUtils.h" |
139 |
+-#include "nsXPCOMPrivate.h" // for XPCOM_FILE_PATH_SEPARATOR |
140 |
+ |
141 |
+ #include "SpecialSystemDirectory.h" |
142 |
+ |
143 |
+@@ -215,6 +214,9 @@ nsresult nsXREDirProvider::GetUserProfilesRootDir(nsIFile** aResult) { |
144 |
+ nsresult rv = GetUserDataDirectory(getter_AddRefs(file), false); |
145 |
+ |
146 |
+ if (NS_SUCCEEDED(rv)) { |
147 |
++#if !defined(XP_UNIX) || defined(XP_MACOSX) |
148 |
++ rv = file->AppendNative(NS_LITERAL_CSTRING("Profiles")); |
149 |
++#endif |
150 |
+ // We must create the profile directory here if it does not exist. |
151 |
+ nsresult tmp = EnsureDirectoryExists(file); |
152 |
+ if (NS_FAILED(tmp)) { |
153 |
+@@ -230,6 +232,9 @@ nsresult nsXREDirProvider::GetUserProfilesLocalDir(nsIFile** aResult) { |
154 |
+ nsresult rv = GetUserDataDirectory(getter_AddRefs(file), true); |
155 |
+ |
156 |
+ if (NS_SUCCEEDED(rv)) { |
157 |
++#if !defined(XP_UNIX) || defined(XP_MACOSX) |
158 |
++ rv = file->AppendNative(NS_LITERAL_CSTRING("Profiles")); |
159 |
++#endif |
160 |
+ // We must create the profile directory here if it does not exist. |
161 |
+ nsresult tmp = EnsureDirectoryExists(file); |
162 |
+ if (NS_FAILED(tmp)) { |
163 |
+@@ -1332,42 +1337,84 @@ nsresult nsXREDirProvider::GetProfileDir(nsIFile** aResult) { |
164 |
+ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, |
165 |
+ bool aLocal) { |
166 |
+ // Copied from nsAppFileLocationProvider (more or less) |
167 |
+- NS_ENSURE_ARG_POINTER(aFile); |
168 |
++ nsresult rv; |
169 |
+ nsCOMPtr<nsIFile> localDir; |
170 |
+ |
171 |
+- nsresult rv = GetAppDir()->Clone(getter_AddRefs(localDir)); |
172 |
+- NS_ENSURE_SUCCESS(rv, rv); |
173 |
+- |
174 |
+- int levelsToRemove = 1; // In FF21+, appDir points to browser subdirectory. |
175 |
+ #if defined(XP_MACOSX) |
176 |
+- levelsToRemove += 2; |
177 |
++ FSRef fsRef; |
178 |
++ OSType folderType; |
179 |
++ if (aLocal) { |
180 |
++ folderType = kCachedDataFolderType; |
181 |
++ } else { |
182 |
++#ifdef MOZ_THUNDERBIRD |
183 |
++ folderType = kDomainLibraryFolderType; |
184 |
++#else |
185 |
++ folderType = kApplicationSupportFolderType; |
186 |
+ #endif |
187 |
+- while (localDir && (levelsToRemove > 0)) { |
188 |
+- // When crawling up the hierarchy, components named "." do not count. |
189 |
+- nsAutoCString removedName; |
190 |
+- rv = localDir->GetNativeLeafName(removedName); |
191 |
+- NS_ENSURE_SUCCESS(rv, rv); |
192 |
+- bool didRemove = !removedName.Equals("."); |
193 |
+- |
194 |
+- // Remove a directory component. |
195 |
+- nsCOMPtr<nsIFile> parentDir; |
196 |
+- rv = localDir->GetParent(getter_AddRefs(parentDir)); |
197 |
+- NS_ENSURE_SUCCESS(rv, rv); |
198 |
+- localDir = parentDir; |
199 |
+- if (didRemove) --levelsToRemove; |
200 |
+ } |
201 |
++ OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef); |
202 |
++ NS_ENSURE_FALSE(err, NS_ERROR_FAILURE); |
203 |
+ |
204 |
+- if (!localDir) return NS_ERROR_FAILURE; |
205 |
++ rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(localDir)); |
206 |
++ NS_ENSURE_SUCCESS(rv, rv); |
207 |
++ |
208 |
++ nsCOMPtr<nsILocalFileMac> dirFileMac = do_QueryInterface(localDir); |
209 |
++ NS_ENSURE_TRUE(dirFileMac, NS_ERROR_UNEXPECTED); |
210 |
+ |
211 |
+- rv = localDir->AppendRelativeNativePath( |
212 |
+- NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR |
213 |
+- "Data" XPCOM_FILE_PATH_SEPARATOR "Browser")); |
214 |
++ rv = dirFileMac->InitWithFSRef(&fsRef); |
215 |
+ NS_ENSURE_SUCCESS(rv, rv); |
216 |
+ |
217 |
++ localDir = do_QueryInterface(dirFileMac, &rv); |
218 |
++#elif defined(XP_IOS) |
219 |
++ nsAutoCString userDir; |
220 |
++ if (GetUIKitDirectory(aLocal, userDir)) { |
221 |
++ rv = NS_NewNativeLocalFile(userDir, true, getter_AddRefs(localDir)); |
222 |
++ } else { |
223 |
++ rv = NS_ERROR_FAILURE; |
224 |
++ } |
225 |
++ NS_ENSURE_SUCCESS(rv, rv); |
226 |
++#elif defined(XP_WIN) |
227 |
++ nsString path; |
228 |
+ if (aLocal) { |
229 |
+- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches")); |
230 |
+- NS_ENSURE_SUCCESS(rv, rv); |
231 |
++ rv = GetShellFolderPath(FOLDERID_LocalAppData, path); |
232 |
++ if (NS_FAILED(rv)) rv = GetRegWindowsAppDataFolder(aLocal, path); |
233 |
++ } |
234 |
++ if (!aLocal || NS_FAILED(rv)) { |
235 |
++ rv = GetShellFolderPath(FOLDERID_RoamingAppData, path); |
236 |
++ if (NS_FAILED(rv)) { |
237 |
++ if (!aLocal) rv = GetRegWindowsAppDataFolder(aLocal, path); |
238 |
++ } |
239 |
++ } |
240 |
++ NS_ENSURE_SUCCESS(rv, rv); |
241 |
++ |
242 |
++ rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir)); |
243 |
++#elif defined(XP_UNIX) |
244 |
++ const char* homeDir = getenv("HOME"); |
245 |
++ if (!homeDir || !*homeDir) return NS_ERROR_FAILURE; |
246 |
++ |
247 |
++#ifdef ANDROID /* We want (ProfD == ProfLD) on Android. */ |
248 |
++ aLocal = false; |
249 |
++#endif |
250 |
++ |
251 |
++ if (aLocal) { |
252 |
++ // If $XDG_CACHE_HOME is defined use it, otherwise use $HOME/.cache. |
253 |
++ const char* cacheHome = getenv("XDG_CACHE_HOME"); |
254 |
++ if (cacheHome && *cacheHome) { |
255 |
++ rv = NS_NewNativeLocalFile(nsDependentCString(cacheHome), true, |
256 |
++ getter_AddRefs(localDir)); |
257 |
++ } else { |
258 |
++ rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true, |
259 |
++ getter_AddRefs(localDir)); |
260 |
++ if (NS_SUCCEEDED(rv)) |
261 |
++ rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache")); |
262 |
++ } |
263 |
++ } else { |
264 |
++ rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true, |
265 |
++ getter_AddRefs(localDir)); |
266 |
+ } |
267 |
++#else |
268 |
++#error "Don't know how to get product dir on your platform" |
269 |
++#endif |
270 |
+ |
271 |
+ NS_IF_ADDREF(*aFile = localDir); |
272 |
+ return rv; |
273 |
+@@ -1537,23 +1584,39 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) { |
274 |
+ } |
275 |
+ |
276 |
+ nsAutoCString profile; |
277 |
++ nsAutoCString appName; |
278 |
++ nsAutoCString vendor; |
279 |
+ if (gAppData->profile) { |
280 |
+ profile = gAppData->profile; |
281 |
++ } else { |
282 |
++ appName = gAppData->name; |
283 |
++ vendor = gAppData->vendor; |
284 |
+ } |
285 |
+ |
286 |
+- nsresult rv = NS_ERROR_FAILURE; |
287 |
++ nsresult rv; |
288 |
+ |
289 |
+ #if defined(XP_MACOSX) |
290 |
+ if (!profile.IsEmpty()) { |
291 |
+ rv = AppendProfileString(aFile, profile.get()); |
292 |
+- NS_ENSURE_SUCCESS(rv, rv); |
293 |
++ } else { |
294 |
++ // Note that MacOS ignores the vendor when creating the profile hierarchy - |
295 |
++ // all application preferences directories live alongside one another in |
296 |
++ // ~/Library/Application Support/ |
297 |
++ rv = aFile->AppendNative(appName); |
298 |
+ } |
299 |
++ NS_ENSURE_SUCCESS(rv, rv); |
300 |
+ |
301 |
+ #elif defined(XP_WIN) |
302 |
+ if (!profile.IsEmpty()) { |
303 |
+ rv = AppendProfileString(aFile, profile.get()); |
304 |
+- NS_ENSURE_SUCCESS(rv, rv); |
305 |
++ } else { |
306 |
++ if (!vendor.IsEmpty()) { |
307 |
++ rv = aFile->AppendNative(vendor); |
308 |
++ NS_ENSURE_SUCCESS(rv, rv); |
309 |
++ } |
310 |
++ rv = aFile->AppendNative(appName); |
311 |
+ } |
312 |
++ NS_ENSURE_SUCCESS(rv, rv); |
313 |
+ |
314 |
+ #elif defined(ANDROID) |
315 |
+ // The directory used for storing profiles |
316 |
+@@ -1563,6 +1626,11 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) { |
317 |
+ rv = aFile->AppendNative(nsDependentCString("mozilla")); |
318 |
+ NS_ENSURE_SUCCESS(rv, rv); |
319 |
+ #elif defined(XP_UNIX) |
320 |
++ nsAutoCString folder; |
321 |
++ // Make it hidden (by starting with "."), except when local (the |
322 |
++ // profile is already under ~/.cache or XDG_CACHE_HOME). |
323 |
++ if (!aLocal) folder.Assign('.'); |
324 |
++ |
325 |
+ if (!profile.IsEmpty()) { |
326 |
+ // Skip any leading path characters |
327 |
+ const char* profileStart = profile.get(); |
328 |
+@@ -1570,16 +1638,29 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) { |
329 |
+ |
330 |
+ // On the off chance that someone wanted their folder to be hidden don't |
331 |
+ // let it become ".." |
332 |
+- if (*profileStart == '.') profileStart++; |
333 |
++ if (*profileStart == '.' && !aLocal) profileStart++; |
334 |
+ |
335 |
+- // Make it hidden (by starting with "."). |
336 |
+- nsAutoCString folder("."); |
337 |
+ folder.Append(profileStart); |
338 |
+ ToLowerCase(folder); |
339 |
+ |
340 |
+ rv = AppendProfileString(aFile, folder.BeginReading()); |
341 |
+- NS_ENSURE_SUCCESS(rv, rv); |
342 |
++ } else { |
343 |
++ if (!vendor.IsEmpty()) { |
344 |
++ folder.Append(vendor); |
345 |
++ ToLowerCase(folder); |
346 |
++ |
347 |
++ rv = aFile->AppendNative(folder); |
348 |
++ NS_ENSURE_SUCCESS(rv, rv); |
349 |
++ |
350 |
++ folder.Truncate(); |
351 |
++ } |
352 |
++ |
353 |
++ folder.Append(appName); |
354 |
++ ToLowerCase(folder); |
355 |
++ |
356 |
++ rv = aFile->AppendNative(folder); |
357 |
+ } |
358 |
++ NS_ENSURE_SUCCESS(rv, rv); |
359 |
+ |
360 |
+ #else |
361 |
+ #error "Don't know how to get profile path on your platform" |
362 |
+diff --git a/toolkit/xre/nsXREDirProvider.h b/toolkit/xre/nsXREDirProvider.h |
363 |
+index 6b92f3812882..5060b33cdded 100644 |
364 |
+--- a/toolkit/xre/nsXREDirProvider.h |
365 |
++++ b/toolkit/xre/nsXREDirProvider.h |
366 |
+@@ -48,15 +48,15 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2, |
367 |
+ |
368 |
+ void DoShutdown(); |
369 |
+ |
370 |
+- nsresult GetUserAppDataDirectory(nsIFile** aFile) { |
371 |
++ static nsresult GetUserAppDataDirectory(nsIFile** aFile) { |
372 |
+ return GetUserDataDirectory(aFile, false); |
373 |
+ } |
374 |
+- nsresult GetUserLocalDataDirectory(nsIFile** aFile) { |
375 |
++ static nsresult GetUserLocalDataDirectory(nsIFile** aFile) { |
376 |
+ return GetUserDataDirectory(aFile, true); |
377 |
+ } |
378 |
+ |
379 |
+ // GetUserDataDirectory gets the profile path from gAppData. |
380 |
+- nsresult GetUserDataDirectory(nsIFile** aFile, bool aLocal); |
381 |
++ static nsresult GetUserDataDirectory(nsIFile** aFile, bool aLocal); |
382 |
+ |
383 |
+ /* make sure you clone it, if you need to do stuff to it */ |
384 |
+ nsIFile* GetGREDir() { return mGREDir; } |
385 |
+@@ -90,9 +90,9 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2, |
386 |
+ protected: |
387 |
+ nsresult GetFilesInternal(const char* aProperty, |
388 |
+ nsISimpleEnumerator** aResult); |
389 |
+- nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal); |
390 |
+- nsresult GetSysUserExtensionsDirectory(nsIFile** aFile); |
391 |
+- nsresult GetSysUserExtensionsDevDirectory(nsIFile** aFile); |
392 |
++ static nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal); |
393 |
++ static nsresult GetSysUserExtensionsDirectory(nsIFile** aFile); |
394 |
++ static nsresult GetSysUserExtensionsDevDirectory(nsIFile** aFile); |
395 |
+ #if defined(XP_UNIX) || defined(XP_MACOSX) |
396 |
+ static nsresult GetSystemExtensionsDirectory(nsIFile** aFile); |
397 |
+ #endif |
398 |
+diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp |
399 |
+index 2aa5482f5789..f1491595a8ea 100644 |
400 |
+--- a/xpcom/io/nsAppFileLocationProvider.cpp |
401 |
++++ b/xpcom/io/nsAppFileLocationProvider.cpp |
402 |
+@@ -14,7 +14,6 @@ |
403 |
+ #include "nsISimpleEnumerator.h" |
404 |
+ #include "prenv.h" |
405 |
+ #include "nsCRT.h" |
406 |
+-#include "nsXPCOMPrivate.h" // for XPCOM_FILE_PATH_SEPARATOR |
407 |
+ #if defined(MOZ_WIDGET_COCOA) |
408 |
+ #include <Carbon/Carbon.h> |
409 |
+ #include "nsILocalFileMac.h" |
410 |
+@@ -248,8 +247,9 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) { |
411 |
+ // GetProductDirectory - Gets the directory which contains the application data |
412 |
+ // folder |
413 |
+ // |
414 |
+-// UNIX and WIN : <App Folder>/TorBrowser/Data/Browser |
415 |
+-// Mac : <App Folder>/../../TorBrowser/Data/Browser |
416 |
++// UNIX : ~/.mozilla/ |
417 |
++// WIN : <Application Data folder on user's machine>\Mozilla |
418 |
++// Mac : :Documents:Mozilla: |
419 |
+ //---------------------------------------------------------------------------------------- |
420 |
+ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, |
421 |
+ bool aLocal) { |
422 |
+@@ -261,45 +261,49 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, |
423 |
+ bool exists; |
424 |
+ nsCOMPtr<nsIFile> localDir; |
425 |
+ |
426 |
+- rv = CloneMozBinDirectory(getter_AddRefs(localDir)); |
427 |
+- NS_ENSURE_SUCCESS(rv, rv); |
428 |
+- |
429 |
+- int levelsToRemove = 1; // In FF21+, bin dir points to browser subdirectory. |
430 |
+-#if defined(XP_MACOSX) |
431 |
+- levelsToRemove += 2; |
432 |
+-#endif |
433 |
+- while (localDir && (levelsToRemove > 0)) { |
434 |
+- // When crawling up the hierarchy, components named "." do not count. |
435 |
+- nsAutoCString removedName; |
436 |
+- rv = localDir->GetNativeLeafName(removedName); |
437 |
+- NS_ENSURE_SUCCESS(rv, rv); |
438 |
+- bool didRemove = !removedName.Equals("."); |
439 |
+- |
440 |
+- // Remove a directory component. |
441 |
+- nsCOMPtr<nsIFile> parentDir; |
442 |
+- rv = localDir->GetParent(getter_AddRefs(parentDir)); |
443 |
+- NS_ENSURE_SUCCESS(rv, rv); |
444 |
+- localDir = parentDir; |
445 |
+- |
446 |
+- if (didRemove) { |
447 |
+- --levelsToRemove; |
448 |
+- } |
449 |
++#if defined(MOZ_WIDGET_COCOA) |
450 |
++ FSRef fsRef; |
451 |
++ OSType folderType = |
452 |
++ aLocal ? (OSType)kCachedDataFolderType : (OSType)kDomainLibraryFolderType; |
453 |
++ OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef); |
454 |
++ if (err) { |
455 |
++ return NS_ERROR_FAILURE; |
456 |
+ } |
457 |
+- |
458 |
++ NS_NewLocalFile(EmptyString(), true, getter_AddRefs(localDir)); |
459 |
+ if (!localDir) { |
460 |
+ return NS_ERROR_FAILURE; |
461 |
+ } |
462 |
+- |
463 |
+- rv = localDir->AppendRelativeNativePath( |
464 |
+- NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR |
465 |
+- "Data" XPCOM_FILE_PATH_SEPARATOR "Browser")); |
466 |
+- NS_ENSURE_SUCCESS(rv, rv); |
467 |
+- |
468 |
+- if (aLocal) { |
469 |
+- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches")); |
470 |
+- NS_ENSURE_SUCCESS(rv, rv); |
471 |
++ nsCOMPtr<nsILocalFileMac> localDirMac(do_QueryInterface(localDir)); |
472 |
++ rv = localDirMac->InitWithFSRef(&fsRef); |
473 |
++ if (NS_FAILED(rv)) { |
474 |
++ return rv; |
475 |
++ } |
476 |
++#elif defined(XP_WIN) |
477 |
++ nsCOMPtr<nsIProperties> directoryService = |
478 |
++ do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); |
479 |
++ if (NS_FAILED(rv)) { |
480 |
++ return rv; |
481 |
++ } |
482 |
++ const char* prop = aLocal ? NS_WIN_LOCAL_APPDATA_DIR : NS_WIN_APPDATA_DIR; |
483 |
++ rv = directoryService->Get(prop, NS_GET_IID(nsIFile), |
484 |
++ getter_AddRefs(localDir)); |
485 |
++ if (NS_FAILED(rv)) { |
486 |
++ return rv; |
487 |
++ } |
488 |
++#elif defined(XP_UNIX) |
489 |
++ rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true, |
490 |
++ getter_AddRefs(localDir)); |
491 |
++ if (NS_FAILED(rv)) { |
492 |
++ return rv; |
493 |
+ } |
494 |
++#else |
495 |
++#error dont_know_how_to_get_product_dir_on_your_platform |
496 |
++#endif |
497 |
+ |
498 |
++ rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR); |
499 |
++ if (NS_FAILED(rv)) { |
500 |
++ return rv; |
501 |
++ } |
502 |
+ rv = localDir->Exists(&exists); |
503 |
+ |
504 |
+ if (NS_SUCCEEDED(rv) && !exists) { |
505 |
+@@ -318,6 +322,10 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, |
506 |
+ //---------------------------------------------------------------------------------------- |
507 |
+ // GetDefaultUserProfileRoot - Gets the directory which contains each user |
508 |
+ // profile dir |
509 |
++// |
510 |
++// UNIX : ~/.mozilla/ |
511 |
++// WIN : <Application Data folder on user's machine>\Mozilla\Profiles |
512 |
++// Mac : :Documents:Mozilla:Profiles: |
513 |
+ //---------------------------------------------------------------------------------------- |
514 |
+ nsresult nsAppFileLocationProvider::GetDefaultUserProfileRoot( |
515 |
+ nsIFile** aLocalFile, bool aLocal) { |
516 |
+@@ -333,6 +341,23 @@ nsresult nsAppFileLocationProvider::GetDefaultUserProfileRoot( |
517 |
+ return rv; |
518 |
+ } |
519 |
+ |
520 |
++#if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN) |
521 |
++ // These 3 platforms share this part of the path - do them as one |
522 |
++ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("Profiles")); |
523 |
++ if (NS_FAILED(rv)) { |
524 |
++ return rv; |
525 |
++ } |
526 |
++ |
527 |
++ bool exists; |
528 |
++ rv = localDir->Exists(&exists); |
529 |
++ if (NS_SUCCEEDED(rv) && !exists) { |
530 |
++ rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0775); |
531 |
++ } |
532 |
++ if (NS_FAILED(rv)) { |
533 |
++ return rv; |
534 |
++ } |
535 |
++#endif |
536 |
++ |
537 |
+ localDir.forget(aLocalFile); |
538 |
+ |
539 |
+ return rv; |
540 |
+-- |
541 |
+2.19.2 |
542 |
+ |
543 |
|
544 |
diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch b/www-client/torbrowser/files/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch |
545 |
new file mode 100644 |
546 |
index 0000000..a4e6ae9 |
547 |
--- /dev/null |
548 |
+++ b/www-client/torbrowser/files/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch |
549 |
@@ -0,0 +1,189 @@ |
550 |
+From 0e4105afea7b10cf20ab20cb41b187d7d690ff46 Mon Sep 17 00:00:00 2001 |
551 |
+From: Poncho <poncho@××××××.ch> |
552 |
+Date: Wed, 30 Jan 2019 09:55:25 +0100 |
553 |
+Subject: [PATCH 1/4] Revert "Bug 13252: Do not store data in the app bundle" |
554 |
+ |
555 |
+This reverts commit 2ee4d81a2fbcac90996f4f4a99633a0b2d7019bb. |
556 |
+--- |
557 |
+ toolkit/xre/nsXREDirProvider.cpp | 43 ++++++++++++--------- |
558 |
+ toolkit/xre/nsXREDirProvider.h | 6 --- |
559 |
+ xpcom/io/nsAppFileLocationProvider.cpp | 53 +++++++++++++++----------- |
560 |
+ 3 files changed, 55 insertions(+), 47 deletions(-) |
561 |
+ |
562 |
+diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp |
563 |
+index d811da50b63d..dbbaffd2a15f 100644 |
564 |
+--- a/toolkit/xre/nsXREDirProvider.cpp |
565 |
++++ b/toolkit/xre/nsXREDirProvider.cpp |
566 |
+@@ -44,8 +44,6 @@ |
567 |
+ #include "mozilla/Preferences.h" |
568 |
+ #include "mozilla/Telemetry.h" |
569 |
+ |
570 |
+-#include "TorFileUtils.h" |
571 |
+- |
572 |
+ #include <stdlib.h> |
573 |
+ |
574 |
+ #ifdef XP_WIN |
575 |
+@@ -1337,18 +1335,34 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, |
576 |
+ NS_ENSURE_ARG_POINTER(aFile); |
577 |
+ nsCOMPtr<nsIFile> localDir; |
578 |
+ |
579 |
+- nsresult rv = GetTorBrowserUserDataDir(getter_AddRefs(localDir)); |
580 |
++ nsresult rv = GetAppDir()->Clone(getter_AddRefs(localDir)); |
581 |
+ NS_ENSURE_SUCCESS(rv, rv); |
582 |
+ |
583 |
+-#if !defined(ANDROID) |
584 |
+-#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR |
585 |
+- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Browser")); |
586 |
+-#else |
587 |
+- rv = localDir->AppendRelativeNativePath( |
588 |
+- NS_LITERAL_CSTRING("Data" XPCOM_FILE_PATH_SEPARATOR "Browser")); |
589 |
++ int levelsToRemove = 1; // In FF21+, appDir points to browser subdirectory. |
590 |
++#if defined(XP_MACOSX) |
591 |
++ levelsToRemove += 2; |
592 |
+ #endif |
593 |
++ while (localDir && (levelsToRemove > 0)) { |
594 |
++ // When crawling up the hierarchy, components named "." do not count. |
595 |
++ nsAutoCString removedName; |
596 |
++ rv = localDir->GetNativeLeafName(removedName); |
597 |
++ NS_ENSURE_SUCCESS(rv, rv); |
598 |
++ bool didRemove = !removedName.Equals("."); |
599 |
++ |
600 |
++ // Remove a directory component. |
601 |
++ nsCOMPtr<nsIFile> parentDir; |
602 |
++ rv = localDir->GetParent(getter_AddRefs(parentDir)); |
603 |
++ NS_ENSURE_SUCCESS(rv, rv); |
604 |
++ localDir = parentDir; |
605 |
++ if (didRemove) --levelsToRemove; |
606 |
++ } |
607 |
++ |
608 |
++ if (!localDir) return NS_ERROR_FAILURE; |
609 |
++ |
610 |
++ rv = localDir->AppendRelativeNativePath( |
611 |
++ NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR |
612 |
++ "Data" XPCOM_FILE_PATH_SEPARATOR "Browser")); |
613 |
+ NS_ENSURE_SUCCESS(rv, rv); |
614 |
+-#endif |
615 |
+ |
616 |
+ if (aLocal) { |
617 |
+ rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches")); |
618 |
+@@ -1433,15 +1447,6 @@ nsresult nsXREDirProvider::GetUserDataDirectory(nsIFile** aFile, bool aLocal) { |
619 |
+ return NS_OK; |
620 |
+ } |
621 |
+ |
622 |
+-nsresult nsXREDirProvider::GetTorBrowserUserDataDir(nsIFile** aFile) { |
623 |
+- NS_ENSURE_ARG_POINTER(aFile); |
624 |
+- nsCOMPtr<nsIFile> exeFile; |
625 |
+- bool per = false; |
626 |
+- nsresult rv = GetFile(XRE_EXECUTABLE_FILE, &per, getter_AddRefs(exeFile)); |
627 |
+- NS_ENSURE_SUCCESS(rv, rv); |
628 |
+- return TorBrowser_GetUserDataDir(exeFile, aFile); |
629 |
+-} |
630 |
+- |
631 |
+ nsresult nsXREDirProvider::EnsureDirectoryExists(nsIFile* aDirectory) { |
632 |
+ bool exists; |
633 |
+ nsresult rv = aDirectory->Exists(&exists); |
634 |
+diff --git a/toolkit/xre/nsXREDirProvider.h b/toolkit/xre/nsXREDirProvider.h |
635 |
+index 6fe9d9ecbce5..6b92f3812882 100644 |
636 |
+--- a/toolkit/xre/nsXREDirProvider.h |
637 |
++++ b/toolkit/xre/nsXREDirProvider.h |
638 |
+@@ -87,12 +87,6 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2, |
639 |
+ */ |
640 |
+ nsresult GetProfileDir(nsIFile** aResult); |
641 |
+ |
642 |
+- /** |
643 |
+- * Get the TorBrowser user data directory by calling the |
644 |
+- * TorBrowser_GetUserDataDir() utility function. |
645 |
+- */ |
646 |
+- nsresult GetTorBrowserUserDataDir(nsIFile** aFile); |
647 |
+- |
648 |
+ protected: |
649 |
+ nsresult GetFilesInternal(const char* aProperty, |
650 |
+ nsISimpleEnumerator** aResult); |
651 |
+diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp |
652 |
+index 3906c6590090..2aa5482f5789 100644 |
653 |
+--- a/xpcom/io/nsAppFileLocationProvider.cpp |
654 |
++++ b/xpcom/io/nsAppFileLocationProvider.cpp |
655 |
+@@ -27,8 +27,6 @@ |
656 |
+ #include <sys/param.h> |
657 |
+ #endif |
658 |
+ |
659 |
+-#include "TorFileUtils.h" |
660 |
+- |
661 |
+ // WARNING: These hard coded names need to go away. They need to |
662 |
+ // come from localizable resources |
663 |
+ |
664 |
+@@ -250,14 +248,8 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) { |
665 |
+ // GetProductDirectory - Gets the directory which contains the application data |
666 |
+ // folder |
667 |
+ // |
668 |
+-#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR |
669 |
+-// UNIX and WIN : <App Folder>/../TorBrowser-Data/Browser |
670 |
+-// Mac : <App Folder>/../../../TorBrowser-Data/Browser OR |
671 |
+-// ~/Library/Application Support/TorBrowser-Data/Browser |
672 |
+-#else |
673 |
+ // UNIX and WIN : <App Folder>/TorBrowser/Data/Browser |
674 |
+ // Mac : <App Folder>/../../TorBrowser/Data/Browser |
675 |
+-#endif |
676 |
+ //---------------------------------------------------------------------------------------- |
677 |
+ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, |
678 |
+ bool aLocal) { |
679 |
+@@ -265,25 +257,42 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, |
680 |
+ return NS_ERROR_INVALID_ARG; |
681 |
+ } |
682 |
+ |
683 |
+- nsresult rv = NS_ERROR_UNEXPECTED; |
684 |
++ nsresult rv; |
685 |
+ bool exists; |
686 |
+- nsCOMPtr<nsIFile> localDir, exeFile; |
687 |
++ nsCOMPtr<nsIFile> localDir; |
688 |
+ |
689 |
+- nsCOMPtr<nsIProperties> directoryService( |
690 |
+- do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); |
691 |
+- NS_ENSURE_SUCCESS(rv, rv); |
692 |
+- rv = directoryService->Get(XRE_EXECUTABLE_FILE, NS_GET_IID(nsIFile), |
693 |
+- getter_AddRefs(exeFile)); |
694 |
+- NS_ENSURE_SUCCESS(rv, rv); |
695 |
+- rv = TorBrowser_GetUserDataDir(exeFile, getter_AddRefs(localDir)); |
696 |
++ rv = CloneMozBinDirectory(getter_AddRefs(localDir)); |
697 |
+ NS_ENSURE_SUCCESS(rv, rv); |
698 |
+ |
699 |
+-#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR |
700 |
+- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Browser")); |
701 |
+-#else |
702 |
+- rv = localDir->AppendRelativeNativePath( |
703 |
+- NS_LITERAL_CSTRING("Data" XPCOM_FILE_PATH_SEPARATOR "Browser")); |
704 |
++ int levelsToRemove = 1; // In FF21+, bin dir points to browser subdirectory. |
705 |
++#if defined(XP_MACOSX) |
706 |
++ levelsToRemove += 2; |
707 |
+ #endif |
708 |
++ while (localDir && (levelsToRemove > 0)) { |
709 |
++ // When crawling up the hierarchy, components named "." do not count. |
710 |
++ nsAutoCString removedName; |
711 |
++ rv = localDir->GetNativeLeafName(removedName); |
712 |
++ NS_ENSURE_SUCCESS(rv, rv); |
713 |
++ bool didRemove = !removedName.Equals("."); |
714 |
++ |
715 |
++ // Remove a directory component. |
716 |
++ nsCOMPtr<nsIFile> parentDir; |
717 |
++ rv = localDir->GetParent(getter_AddRefs(parentDir)); |
718 |
++ NS_ENSURE_SUCCESS(rv, rv); |
719 |
++ localDir = parentDir; |
720 |
++ |
721 |
++ if (didRemove) { |
722 |
++ --levelsToRemove; |
723 |
++ } |
724 |
++ } |
725 |
++ |
726 |
++ if (!localDir) { |
727 |
++ return NS_ERROR_FAILURE; |
728 |
++ } |
729 |
++ |
730 |
++ rv = localDir->AppendRelativeNativePath( |
731 |
++ NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR |
732 |
++ "Data" XPCOM_FILE_PATH_SEPARATOR "Browser")); |
733 |
+ NS_ENSURE_SUCCESS(rv, rv); |
734 |
+ |
735 |
+ if (aLocal) { |
736 |
+-- |
737 |
+2.19.2 |
738 |
+ |
739 |
|
740 |
diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch b/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch |
741 |
new file mode 100644 |
742 |
index 0000000..48289b0 |
743 |
--- /dev/null |
744 |
+++ b/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch |
745 |
@@ -0,0 +1,25 @@ |
746 |
+From f749a3cc5fc0397e5f4c0948dd35beacac17e2d5 Mon Sep 17 00:00:00 2001 |
747 |
+From: Poncho <poncho@××××××.ch> |
748 |
+Date: Sun, 16 Aug 2015 14:47:29 +0200 |
749 |
+Subject: [PATCH 4/4] security/nss/coreconf/Linux.mk: add -fno-strict-aliasing |
750 |
+ |
751 |
+taken from nss-3.15-gentoo-fixup-warnings.patch |
752 |
+--- |
753 |
+ security/nss/coreconf/Linux.mk | 1 + |
754 |
+ 1 file changed, 1 insertion(+) |
755 |
+ |
756 |
+diff --git a/security/nss/coreconf/Linux.mk b/security/nss/coreconf/Linux.mk |
757 |
+index bb9db413b411..43355237f98a 100644 |
758 |
+--- a/security/nss/coreconf/Linux.mk |
759 |
++++ b/security/nss/coreconf/Linux.mk |
760 |
+@@ -119,6 +119,7 @@ ifdef MOZ_DEBUG_SYMBOLS |
761 |
+ OPTIMIZER += -gdwarf-2 |
762 |
+ endif |
763 |
+ endif |
764 |
++OPTIMIZER += -fno-strict-aliasing |
765 |
+ endif |
766 |
+ |
767 |
+ ifndef COMPILER_TAG |
768 |
+-- |
769 |
+2.19.2 |
770 |
+ |
771 |
|
772 |
diff --git a/www-client/torbrowser/files/torbrowser-lto.patch b/www-client/torbrowser/files/torbrowser-lto.patch |
773 |
deleted file mode 100644 |
774 |
index 2db67db..0000000 |
775 |
--- a/www-client/torbrowser/files/torbrowser-lto.patch |
776 |
+++ /dev/null |
777 |
@@ -1,32 +0,0 @@ |
778 |
---- a/security/sandbox/linux/moz.build |
779 |
-+++ b/security/sandbox/linux/moz.build |
780 |
-@@ -102,7 +102,12 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc') |
781 |
- # gcc lto likes to put the top level asm in syscall.cc in a different partition |
782 |
- # from the function using it which breaks the build. Work around that by |
783 |
- # forcing there to be only one partition. |
784 |
--if '-flto' in CONFIG['OS_CXXFLAGS'] and CONFIG['CC_TYPE'] != 'clang': |
785 |
-+lto=False |
786 |
-+for f in CONFIG['OS_CXXFLAGS']: |
787 |
-+ if f.startswith('-flto'): |
788 |
-+ lto=True |
789 |
-+ break |
790 |
-+if lto and CONFIG['CC_TYPE'] != 'clang': |
791 |
- LDFLAGS += ['--lto-partition=one'] |
792 |
- |
793 |
- if CONFIG['MOZ_ALSA']: |
794 |
---- a/build/unix/elfhack/moz.build |
795 |
-+++ b/build/unix/elfhack/moz.build |
796 |
-@@ -14,7 +14,12 @@ if not CONFIG['CROSS_COMPILE']: |
797 |
- 'test-ctors.c', |
798 |
- ] |
799 |
- |
800 |
-- if '-flto' in CONFIG['OS_CFLAGS']: |
801 |
-+ lto=False |
802 |
-+ for f in CONFIG['OS_CFLAGS']: |
803 |
-+ if f.startswith('-flto'): |
804 |
-+ lto=True |
805 |
-+ break |
806 |
-+ if lto: |
807 |
- SOURCES['test-array.c'].flags += ['-fno-lto'] |
808 |
- SOURCES['test-ctors.c'].flags += ['-fno-lto'] |
809 |
- |
810 |
|
811 |
diff --git a/www-client/torbrowser/files/torbrowser-profiledir.patch b/www-client/torbrowser/files/torbrowser-profiledir.patch |
812 |
deleted file mode 100644 |
813 |
index bec2495..0000000 |
814 |
--- a/www-client/torbrowser/files/torbrowser-profiledir.patch |
815 |
+++ /dev/null |
816 |
@@ -1,44 +0,0 @@ |
817 |
---- a/xpcom/io/TorFileUtils.cpp |
818 |
-+++ b/xpcom/io/TorFileUtils.cpp |
819 |
-@@ -81,7 +81,7 @@ |
820 |
- } |
821 |
- #endif |
822 |
- |
823 |
--#elif defined(ANDROID) |
824 |
-+#elif defined(ANDROID) || defined(TOR_BROWSER_DATA_IN_HOME_DIR) |
825 |
- // Orfox stores data in the app home directory. |
826 |
- const char* homeDir = getenv("HOME"); |
827 |
- if (!homeDir || !*homeDir) |
828 |
---- a/toolkit/xre/nsXREDirProvider.cpp |
829 |
-+++ b/toolkit/xre/nsXREDirProvider.cpp |
830 |
-@@ -1283,6 +1283,9 @@ |
831 |
- #if !defined(ANDROID) |
832 |
- #ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR |
833 |
- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Browser")); |
834 |
-+#elif defined(TOR_BROWSER_DATA_IN_HOME_DIR) |
835 |
-+ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING(MOZ_USER_DIR |
836 |
-+ XPCOM_FILE_PATH_SEPARATOR "torbrowser")); |
837 |
- #else |
838 |
- rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("Data" |
839 |
- XPCOM_FILE_PATH_SEPARATOR "Browser")); |
840 |
-@@ -1291,7 +1294,20 @@ |
841 |
- #endif |
842 |
- |
843 |
- if (aLocal) { |
844 |
-+#ifndef TOR_BROWSER_DATA_IN_HOME_DIR |
845 |
- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches")); |
846 |
-+#else |
847 |
-+ const char* cacheHome = getenv("XDG_CACHE_HOME"); |
848 |
-+ if (cacheHome && *cacheHome) { |
849 |
-+ rv = NS_NewNativeLocalFile(nsDependentCString(cacheHome), true, |
850 |
-+ getter_AddRefs(localDir)); |
851 |
-+ } else { |
852 |
-+ rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true, |
853 |
-+ getter_AddRefs(localDir)); |
854 |
-+ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING(".cache")); |
855 |
-+ } |
856 |
-+ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("torbrowser")); |
857 |
-+#endif |
858 |
- NS_ENSURE_SUCCESS(rv, rv); |
859 |
- } |
860 |
- |
861 |
|
862 |
diff --git a/www-client/torbrowser/files/torbrowser-rust_missing_docs.patch b/www-client/torbrowser/files/torbrowser-rust_missing_docs.patch |
863 |
deleted file mode 100644 |
864 |
index 6b38618..0000000 |
865 |
--- a/www-client/torbrowser/files/torbrowser-rust_missing_docs.patch |
866 |
+++ /dev/null |
867 |
@@ -1,21 +0,0 @@ |
868 |
---- a/servo/components/style_traits/lib.rs |
869 |
-+++ b/servo/components/style_traits/lib.rs |
870 |
-@@ -9,7 +9,7 @@ |
871 |
- #![crate_name = "style_traits"] |
872 |
- #![crate_type = "rlib"] |
873 |
- |
874 |
--#![deny(unsafe_code, missing_docs)] |
875 |
-+#![deny(unsafe_code)] |
876 |
- |
877 |
- extern crate app_units; |
878 |
- #[macro_use] extern crate bitflags; |
879 |
---- a/servo/components/style/lib.rs |
880 |
-+++ b/servo/components/style/lib.rs |
881 |
-@@ -23,7 +23,6 @@ |
882 |
- //! [cssparser]: ../cssparser/index.html |
883 |
- //! [selectors]: ../selectors/index.html |
884 |
- |
885 |
--#![deny(missing_docs)] |
886 |
- |
887 |
- extern crate app_units; |
888 |
- extern crate arrayvec; |
889 |
|
890 |
diff --git a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild |
891 |
similarity index 77% |
892 |
rename from www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild |
893 |
rename to www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild |
894 |
index 9034134..0690db2 100644 |
895 |
--- a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild |
896 |
+++ b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild |
897 |
@@ -29,9 +29,8 @@ GIT_TAG="tor-browser-${MOZ_PV}-$(ver_rs 3 '-build' ${GIT_TAG})" |
898 |
|
899 |
DESCRIPTION="The Tor Browser" |
900 |
HOMEPAGE=" |
901 |
-https://www.torproject.org/projects/torbrowser.html |
902 |
-https://gitweb.torproject.org/tor-browser.git |
903 |
-" |
904 |
+ https://www.torproject.org/projects/torbrowser.html |
905 |
+ https://gitweb.torproject.org/tor-browser.git" |
906 |
|
907 |
SLOT="0" |
908 |
# BSD license applies to torproject-related code like the patches |
909 |
@@ -39,8 +38,8 @@ SLOT="0" |
910 |
LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1" |
911 |
IUSE="hardened hwaccel jack -screenshot selinux test" |
912 |
|
913 |
-SRC_URI="mirror://tor/dist/${PN}/${TOR_PV}" |
914 |
-PATCH="firefox-${PV%%.*}.6-patches-01" |
915 |
+SRC_URI="mirror://tor/${PN}/${TOR_PV}" |
916 |
+PATCH="firefox-${PV%%.*}.6-patches-05" |
917 |
PATCH=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz ) |
918 |
SRC_URI=" |
919 |
https://gitweb.torproject.org/tor-browser.git/snapshot/${GIT_TAG}.tar.gz |
920 |
@@ -55,28 +54,24 @@ SRC_URI=" |
921 |
" |
922 |
RESTRICT="primaryuri" |
923 |
|
924 |
+ASM_DEPEND=">=dev-lang/yasm-1.1" |
925 |
+ |
926 |
RDEPEND=" |
927 |
+ >=net-vpn/tor-0.3.3.9 |
928 |
system-icu? ( >=dev-libs/icu-60.2 ) |
929 |
jack? ( virtual/jack ) |
930 |
- selinux? ( sec-policy/selinux-mozilla ) |
931 |
-" |
932 |
+ selinux? ( sec-policy/selinux-mozilla )" |
933 |
+ |
934 |
DEPEND=" |
935 |
${RDEPEND} |
936 |
- >=sys-devel/llvm-4.0.1 |
937 |
- >=sys-devel/clang-4.0.1 |
938 |
- >=dev-lang/yasm-1.1 |
939 |
- virtual/opengl |
940 |
-" |
941 |
-RDEPEND=" |
942 |
- ${RDEPEND} |
943 |
- >=net-vpn/tor-0.3.3.9 |
944 |
-" |
945 |
+ amd64? ( ${ASM_DEPEND} virtual/opengl ) |
946 |
+ x86? ( ${ASM_DEPEND} virtual/opengl )" |
947 |
|
948 |
S="${WORKDIR}/${GIT_TAG}" |
949 |
|
950 |
-QA_PRESTRIPPED="usr/lib*/${PN}/${PN}/${PN}" |
951 |
+QA_PRESTRIPPED="usr/lib*/${PN}/${PN}" |
952 |
|
953 |
-BUILD_OBJ_DIR="${WORKDIR}/tb" |
954 |
+BUILD_OBJ_DIR="${WORKDIR}/torb" |
955 |
|
956 |
llvm_check_deps() { |
957 |
if ! has_version "sys-devel/clang:${LLVM_SLOT}" ; then |
958 |
@@ -106,9 +101,6 @@ pkg_setup() { |
959 |
XDG_SESSION_COOKIE \ |
960 |
XAUTHORITY |
961 |
|
962 |
- append-cppflags "-DTOR_BROWSER_DATA_IN_HOME_DIR" |
963 |
- MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}/${PN}" |
964 |
- |
965 |
addpredict /proc/self/oom_score_adj |
966 |
|
967 |
llvm_pkg_setup |
968 |
@@ -124,14 +116,14 @@ pkg_pretend() { |
969 |
src_prepare() { |
970 |
local PATCHES=( |
971 |
"${WORKDIR}"/firefox |
972 |
- "${FILESDIR}"/${PN}-profiledir.patch |
973 |
- "${FILESDIR}"/${PN}-lto.patch |
974 |
- "${FILESDIR}"/${PN}-rust_missing_docs.patch |
975 |
- ) |
976 |
|
977 |
- sed \ |
978 |
- -e '/Unknown option: %s/ s:raise InvalidOptionError:print:' \ |
979 |
- -i python/mozbuild/mozbuild/configure/__init__.py |
980 |
+ # Revert "Change the default Firefox profile directory to be TBB-relative" |
981 |
+ "${FILESDIR}"/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch |
982 |
+ "${FILESDIR}"/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch |
983 |
+ |
984 |
+ # FIXME: prevent warnings in bundled nss |
985 |
+ "${FILESDIR}"/torbrowser-60.5.0-nss-fixup-warnings.patch |
986 |
+ ) |
987 |
|
988 |
# Enable gnomebreakpad |
989 |
if use debug ; then |
990 |
@@ -224,25 +216,37 @@ src_configure() { |
991 |
fi |
992 |
|
993 |
echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig |
994 |
- echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig |
995 |
- |
996 |
- # Default mozilla_five_home no longer valid option |
997 |
- sed '/with-default-mozilla-five-home=/d' -i "${S}"/.mozconfig |
998 |
- # Rename the install directory and the executable |
999 |
- mozconfig_annotate 'torbrowser' --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN} |
1000 |
- mozconfig_annotate 'torbrowser' --with-app-name=${PN} |
1001 |
- mozconfig_annotate 'torbrowser' --with-app-basename=${PN} |
1002 |
- mozconfig_annotate 'torbrowser' --disable-tor-browser-update |
1003 |
- mozconfig_annotate 'torbrowser' --with-tor-browser-version=${TOR_PV} |
1004 |
- mozconfig_annotate 'torbrowser' --disable-tor-browser-data-outside-app-dir |
1005 |
- mozconfig_annotate 'torbrowser' --with-branding=browser/branding/official |
1006 |
- mozconfig_annotate 'torbrowser' --disable-maintenance-service |
1007 |
+ echo "mk_add_options XARGS="${EPREFIX}"/usr/bin/xargs" >> "${S}"/.mozconfig |
1008 |
+ |
1009 |
+ # Use .mozconfig settings from torbrowser (setting this here since it gets overwritten by mozcoreconf-v6.eclass) |
1010 |
+ # see https://gitweb.torproject.org/tor-browser.git/tree/.mozconfig?h=tor-browser-60.2.0esr-8.0-1 |
1011 |
+ echo "mk_add_options MOZ_APP_DISPLAYNAME=\"Tor Browser\"" >> "${S}"/.mozconfig |
1012 |
+ echo "mk_add_options MOZILLA_OFFICIAL=1" >> "${S}"/.mozconfig |
1013 |
+ echo "mk_add_options BUILD_OFFICIAL=1" >> "${S}"/.mozconfig |
1014 |
+ mozconfig_annotate 'torbrowser' --enable-official-branding |
1015 |
mozconfig_annotate 'torbrowser' --disable-webrtc |
1016 |
mozconfig_annotate 'torbrowser' --disable-eme |
1017 |
+ mozconfig_annotate 'torbrowser' --enable-proxy-bypass-protection |
1018 |
+ |
1019 |
+ # Rename the binary and set the profile location |
1020 |
+ mozconfig_annotate 'torbrowser' --with-app-name="${PN}" |
1021 |
+ mozconfig_annotate 'torbrowser' --with-app-basename="${PN}" |
1022 |
|
1023 |
+ # see https://gitweb.torproject.org/tor-browser.git/tree/old-configure.in?h=tor-browser-60.2.0esr-8.0-1#n3205 |
1024 |
+ mozconfig_annotate 'torbrowser' --with-tor-browser-version="${TOR_PV}" |
1025 |
+ mozconfig_annotate 'torbrowser' --disable-tor-browser-update |
1026 |
+ |
1027 |
+ # torbrowser uses a patched nss library |
1028 |
+ # see https://gitweb.torproject.org/tor-browser.git/log/security/nss?h=tor-browser-60.2.0esr-8.0-1-build1 |
1029 |
mozconfig_annotate 'torbrowser' --without-system-nspr |
1030 |
mozconfig_annotate 'torbrowser' --without-system-nss |
1031 |
|
1032 |
+ echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig |
1033 |
+ echo "mk_add_options XARGS="${EPREFIX}"/usr/bin/xargs" >> "${S}"/.mozconfig |
1034 |
+ |
1035 |
+ # Default mozilla_five_home no longer valid option |
1036 |
+ sed '/with-default-mozilla-five-home=/d' -i "${S}"/.mozconfig |
1037 |
+ |
1038 |
# Finalize and report settings |
1039 |
mozconfig_final |
1040 |
|
1041 |
@@ -253,16 +257,12 @@ src_configure() { |
1042 |
|
1043 |
src_compile() { |
1044 |
MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \ |
1045 |
- BUILD_VERBOSE_LOG=1 \ |
1046 |
./mach build --verbose || die |
1047 |
} |
1048 |
|
1049 |
src_install() { |
1050 |
- local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default" |
1051 |
cd "${BUILD_OBJ_DIR}" || die |
1052 |
- |
1053 |
- cat "${profile_dir}"/bookmarks.html > \ |
1054 |
- dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html |
1055 |
+ export LD_LIBRARY_PATH="${BUILD_OBJ_DIR}/dist/bin" |
1056 |
|
1057 |
# Pax mark xpcshell for hardened support, only used for startupcache creation. |
1058 |
pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell |
1059 |
@@ -287,10 +287,7 @@ src_install() { |
1060 |
|| die |
1061 |
fi |
1062 |
|
1063 |
- sed -e '/extensions\.autoDisableScopes/s:\<0\>:3:' \ |
1064 |
- -i "${BUILD_OBJ_DIR}"/dist/bin/browser/defaults/preferences/000-tor-browser.js \ |
1065 |
- || die |
1066 |
- |
1067 |
+ # Must ensure we use bundled nss/nspr during signing and not system |
1068 |
cd "${S}" |
1069 |
MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \ |
1070 |
DESTDIR="${D}" ./mach install || die |
1071 |
@@ -311,18 +308,22 @@ src_install() { |
1072 |
fi |
1073 |
|
1074 |
# Required in order to use plugins and even run torbrowser on hardened. |
1075 |
- pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{${PN},${PN}-bin,plugin-container} |
1076 |
+ pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{${PN},plugin-container} |
1077 |
|
1078 |
- # Profile without the tor-launcher extension |
1079 |
- # see: https://trac.torproject.org/projects/tor/ticket/10160 |
1080 |
- |
1081 |
- rm "${profile_dir}/extensions/tor-launcher@××××××××××××××.xpi" || die \ |
1082 |
- "Failed to remove torlauncher extension" |
1083 |
+ # Profile with settings and extensions |
1084 |
+ insinto ${MOZILLA_FIVE_HOME}/defaults/profile |
1085 |
+ doins -r "${WORKDIR}"/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default/{extensions,bookmarks.html} |
1086 |
|
1087 |
- insinto ${MOZILLA_FIVE_HOME}/browser |
1088 |
- doins -r "${profile_dir}"/extensions |
1089 |
+ # see: https://trac.torproject.org/projects/tor/ticket/11751#comment:2 |
1090 |
+ # see: https://github.com/Whonix/anon-ws-disable-stacked-tor/blob/master/usr/lib/anon-ws-disable-stacked-tor/torbrowser.sh |
1091 |
+ dodoc "${FILESDIR}/99torbrowser.example" |
1092 |
|
1093 |
dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt" |
1094 |
+ |
1095 |
+ # Profile without the tor-launcher extension |
1096 |
+ # see: https://trac.torproject.org/projects/tor/ticket/10160 |
1097 |
+ rm "${MOZILLA_FIVE_HOME}/defaults/profile/extensions/tor-launcher@××××××××××××××.xpi" || die \ |
1098 |
+ "Failed to remove torlauncher extension" |
1099 |
} |
1100 |
|
1101 |
pkg_preinst() { |