From 21dfb2d43241229bc3681341c53ccf1757a11bbc Mon Sep 17 00:00:00 2001 From: Jim Chen Date: Wed, 8 Feb 2017 13:49:20 -0500 Subject: [PATCH] Bug 1337304. r=snorp --HG-- extra : rebase_source : 7306160ece787ed98fb98ec1bcecbb0466d98093 --- .../main/java/org/mozilla/gecko/mozglue/GeckoLoader.java | 7 ------- mozglue/linker/Mappable.cpp | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java index 6c504d1a3b8d..189e8b0c3b42 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java @@ -216,13 +216,6 @@ public final class GeckoLoader { } putenv("MOZ_LINKER_EXTRACT=1"); - // Ensure that the cache dir is world-writable - File cacheDir = new File(linkerCache); - if (cacheDir.isDirectory()) { - cacheDir.setWritable(true, false); - cacheDir.setExecutable(true, false); - cacheDir.setReadable(true, false); - } } @RobocopTarget diff --git a/mozglue/linker/Mappable.cpp b/mozglue/linker/Mappable.cpp index ef9a6e625ff5..47b883d2d576 100644 --- a/mozglue/linker/Mappable.cpp +++ b/mozglue/linker/Mappable.cpp @@ -149,6 +149,10 @@ MappableExtractFile::Create(const char *name, Zip *zip, Zip::Stream *stream) "not extracting"); return nullptr; } + + // Ensure that the cache dir is private. + chmod(cachePath, 0770); + UniquePtr path = MakeUnique(strlen(cachePath) + strlen(name) + 2); sprintf(path.get(), "%s/%s", cachePath, name);