Bug 1337304. r=snorp, a=ritu
authorJim Chen <nchen@mozilla.com>
Wed, 08 Feb 2017 13:49:20 -0500
changeset 376003 c51d7c9daa243554dcee9fd28d487ae76c512bf2
parent 376002 dd845b53c132cf309391812aa7614f696d4d9018
child 376004 8dcc2332e280ee23815b44ba76f78c9919d9ebd0
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, ritu
bugs1337304
milestone53.0a2
Bug 1337304. r=snorp, a=ritu
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
mozglue/linker/Mappable.cpp
--- 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
@@ -211,23 +211,16 @@ public final class GeckoLoader {
         if (forced_ondemand == null) {
             if ("HTC".equals(android.os.Build.MANUFACTURER) &&
                 "HTC Vision".equals(android.os.Build.MODEL)) {
                 putenv("MOZ_LINKER_ONDEMAND=0");
             }
         }
 
         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
     public synchronized static void loadSQLiteLibs(final Context context, final String apkName) {
         if (sSQLiteLibsLoaded) {
             return;
         }
 
--- a/mozglue/linker/Mappable.cpp
+++ b/mozglue/linker/Mappable.cpp
@@ -144,16 +144,20 @@ MappableExtractFile::Create(const char *
   MOZ_ASSERT(zip && stream);
 
   const char *cachePath = getenv("MOZ_LINKER_CACHE");
   if (!cachePath || !*cachePath) {
     WARN("MOZ_LINKER_EXTRACT is set, but not MOZ_LINKER_CACHE; "
         "not extracting");
     return nullptr;
   }
+
+  // Ensure that the cache dir is private.
+  chmod(cachePath, 0770);
+
   UniquePtr<char[]> path =
     MakeUnique<char[]>(strlen(cachePath) + strlen(name) + 2);
   sprintf(path.get(), "%s/%s", cachePath, name);
 
   CacheValidator validator(path.get(), zip, stream);
   if (validator.IsValid()) {
     DEBUG_LOG("Reusing %s", static_cast<char *>(path.get()));
     return MappableFile::Create(path.get());