summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-10-06 18:50:34 (GMT)
committerJessica Wagantall <jwagantall@cyngn.com>2016-10-06 18:50:34 (GMT)
commitb25fddceb712fc26f7b2eb67ef34e73935cc1182 (patch)
treeaded22e0b800b7d4e3b2d04b15ba98dfcf028901
parentf65b57668dac5336ba31c2611bb0c2bcb7f0c2db (diff)
parent092d6da1fd5ef6b0aac65b8e6249700cf4867815 (diff)
downloadandroid_packages_providers_DownloadProvider-b25fddceb712fc26f7b2eb67ef34e73935cc1182.zip
android_packages_providers_DownloadProvider-b25fddceb712fc26f7b2eb67ef34e73935cc1182.tar.gz
android_packages_providers_DownloadProvider-b25fddceb712fc26f7b2eb67ef34e73935cc1182.tar.bz2
Merge tag 'android-6.0.1_r72' into HEAD
Android 6.0.1 Release 72 (M4B30X) # gpg: Signature made Tue 04 Oct 2016 09:47:45 AM PDT using DSA key ID 9AB10E78 # gpg: Can't check signature: public key not found
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index d9acc78..667a81d 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -1232,6 +1232,19 @@ public final class DownloadProvider extends ContentProvider {
logVerboseOpenFileInfo(uri, mode);
}
+ // Perform normal query to enforce caller identity access before
+ // clearing it to reach internal-only columns
+ final Cursor probeCursor = query(uri, new String[] {
+ Downloads.Impl._DATA }, null, null, null);
+ try {
+ if ((probeCursor == null) || (probeCursor.getCount() == 0)) {
+ throw new FileNotFoundException(
+ "No file found for " + uri + " as UID " + Binder.getCallingUid());
+ }
+ } finally {
+ IoUtils.closeQuietly(probeCursor);
+ }
+
final Cursor cursor = queryCleared(uri, new String[] {
Downloads.Impl._DATA, Downloads.Impl.COLUMN_STATUS,
Downloads.Impl.COLUMN_DESTINATION, Downloads.Impl.COLUMN_MEDIA_SCANNED }, null,