diff options
author | John Reck <jreck@google.com> | 2010-12-03 16:03:14 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-12-03 16:03:14 -0800 |
commit | 6f48ba58140d605971490f5679e6879403f86012 (patch) | |
tree | 336c817cb244bdce1d123067a3f5790028f85a74 /src | |
parent | 89f73c1146f474641881e3e20c77cfbfc18fa313 (diff) | |
download | packages_apps_Browser-6f48ba58140d605971490f5679e6879403f86012.zip packages_apps_Browser-6f48ba58140d605971490f5679e6879403f86012.tar.gz packages_apps_Browser-6f48ba58140d605971490f5679e6879403f86012.tar.bz2 |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Browser.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java index 97b9967..12c0c41 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. |