From 6f48ba58140d605971490f5679e6879403f86012 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 3 Dec 2010 16:03:14 -0800 Subject: Sets umask to prevent world readable files Bug: 3244281 Set the umask on startup so that databases created in native code are not world readable. Change-Id: If0f54b209741645e173f0dd338804fabdafaa31e --- src/com/android/browser/Browser.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/com/android/browser/Browser.java') diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java index 97b99672a..12c0c4182 100644 --- a/src/com/android/browser/Browser.java +++ b/src/com/android/browser/Browser.java @@ -16,6 +16,7 @@ package com.android.browser; +import android.os.FileUtils; import android.util.Log; import android.app.Application; @@ -47,7 +48,11 @@ public class Browser extends Application { public Browser() { } + @Override public void onCreate() { + // Set the umask so that native code creates files with the correct + // permissions (0660) + FileUtils.setUMask(FileUtils.S_IRWXO); if (LOGV_ENABLED) Log.v(LOGTAG, "Browser.onCreate: this=" + this); // Fix heap utilization for better heap size characteristics. -- cgit v1.2.3