diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-03-01 17:23:40 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-01 17:23:40 -0800 |
commit | 67f2957331a63474879f68bf1a8d17b60b2188cd (patch) | |
tree | 505caf00d30dd4fd151a8036e6f497bcd236bdaa /core | |
parent | 00158363b47d916d159d2f3a0e1152783fd66a9c (diff) | |
parent | bb2aa63be4a9328403a4daa2f93b42a4a7b0b65d (diff) | |
download | frameworks_base-67f2957331a63474879f68bf1a8d17b60b2188cd.zip frameworks_base-67f2957331a63474879f68bf1a8d17b60b2188cd.tar.gz frameworks_base-67f2957331a63474879f68bf1a8d17b60b2188cd.tar.bz2 |
am bb2aa63b: am a2e929e1: Tighten enforcement of file modes.
* commit 'bb2aa63be4a9328403a4daa2f93b42a4a7b0b65d':
Tighten enforcement of file modes.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/content/ContentProvider.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index 23d8f46..612ff0b 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -238,7 +238,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { @Override public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { - if (mode != null && mode.startsWith("rw")) enforceWritePermission(uri); + if (mode != null && mode.indexOf('w') != -1) enforceWritePermission(uri); else enforceReadPermission(uri); return ContentProvider.this.openFile(uri, mode); } @@ -246,7 +246,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { @Override public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException { - if (mode != null && mode.startsWith("rw")) enforceWritePermission(uri); + if (mode != null && mode.indexOf('w') != -1) enforceWritePermission(uri); else enforceReadPermission(uri); return ContentProvider.this.openAssetFile(uri, mode); } |