diff options
author | Jeff Sharkey <jsharkey@android.com> | 2016-08-09 19:47:52 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-08-09 19:47:52 +0000 |
commit | 616f47abce356af095e92d8571a02285917e9d92 (patch) | |
tree | ab545fc9aa5953ec1022f031be0fac40fdc1180b /src | |
parent | ebb842e081f2d9eddbeddb9447631fd81e8961b9 (diff) | |
parent | 860239d87ee4353b9d1bb0196b733c9c632be3f9 (diff) | |
download | android_packages_providers_DownloadProvider-616f47abce356af095e92d8571a02285917e9d92.tar.gz android_packages_providers_DownloadProvider-616f47abce356af095e92d8571a02285917e9d92.tar.bz2 android_packages_providers_DownloadProvider-616f47abce356af095e92d8571a02285917e9d92.zip |
Enforce calling identity before clearing. am: 8be3a92eb0 am: ec19fe6485 am: b3ce7976f2
am: 860239d87e
Change-Id: Ic62206ad61c81da00eb57679211c140ce7053032
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/downloads/DownloadProvider.java | 13 |
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 d9acc789..667a81df 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, |