diff options
author | Carlos Valdivia <carlosvaldivia@google.com> | 2013-10-14 17:22:42 -0700 |
---|---|---|
committer | Carlos Valdivia <carlosvaldivia@google.com> | 2013-10-14 18:01:58 -0700 |
commit | 416747aea11351c4327ac74c3a8d7bf338cde946 (patch) | |
tree | b9489e37e5558c6edccee1facaecfc59de844804 | |
parent | a6ffa4ef021ee35a533bc05205d6add6971cc44a (diff) | |
download | frameworks_base-416747aea11351c4327ac74c3a8d7bf338cde946.zip frameworks_base-416747aea11351c4327ac74c3a8d7bf338cde946.tar.gz frameworks_base-416747aea11351c4327ac74c3a8d7bf338cde946.tar.bz2 |
Package checks for resloving recovery tokens should be user sensitive.
Bug: 11219355
Change-Id: Iec031739dc0d751ee9841ca2c495a346d689ad2a
-rw-r--r-- | services/java/com/android/server/accounts/AccountManagerService.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java index cc43a9c..f972f70 100644 --- a/services/java/com/android/server/accounts/AccountManagerService.java +++ b/services/java/com/android/server/accounts/AccountManagerService.java @@ -2167,15 +2167,20 @@ public class AccountManagerService * this can be very bad when those apps are in the system like * the System Settings. */ - PackageManager pm = mContext.getPackageManager(); - ResolveInfo resolveInfo = pm.resolveActivity(intent, 0); - int targetUid = resolveInfo.activityInfo.applicationInfo.uid; int authenticatorUid = Binder.getCallingUid(); - if (PackageManager.SIGNATURE_MATCH != - pm.checkSignatures(authenticatorUid, targetUid)) { - throw new SecurityException( - "Activity to be started with KEY_INTENT must " + - "share Authenticator's signatures"); + long bid = Binder.clearCallingIdentity(); + try { + PackageManager pm = mContext.getPackageManager(); + ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId); + int targetUid = resolveInfo.activityInfo.applicationInfo.uid; + if (PackageManager.SIGNATURE_MATCH != + pm.checkSignatures(authenticatorUid, targetUid)) { + throw new SecurityException( + "Activity to be started with KEY_INTENT must " + + "share Authenticator's signatures"); + } + } finally { + Binder.restoreCallingIdentity(bid); } } if (result != null |