summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDianne Hackborn <nobody@android.com>2009-05-13 18:09:56 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-05-13 18:09:56 -0700
commit5d6d773fab559fdc12e553d60d789f3991ac552c (patch)
tree6188416dceccd82a180f6d478d366270e38ff93e
parent04c72b47d877c9f3b45caa1ddc7f640b02e7be4c (diff)
downloadbase-5d6d773fab559fdc12e553d60d789f3991ac552c.tar.gz
AI 148824: Fix issue #1851541 (sharedUserId requests not being checked for matching signatures on .apk).android-1.5r2
To address issues where we could leave half-installed applications around if there was a failure during the install, we split getPackageLP() into two phases: the first would create the record, and only after doing all verification checks would we call insertPackageSettingLP() to do the remaining part of the original implementation and actually insert the record into the data structures. Unfortunately it was only in insertPackageSettingLP() that we would set the sharedUser field of the PackageSetting structure, so when before that we went to verify certificates, we didn't think it had requested a shared user ID, and let it through without checking. This fix simply sets the sharedUser field when the PackageSetting structure is first created, so we will actually check against its certs. We still also set this again in insertPackageSettingLP(), but there is no harm in this because the only time we call this function is in that big install func, which just passes in the same shared user that it had when first getting the package. BUG=1851541 Automated import of CL 148824
-rw-r--r--services/java/com/android/server/PackageManagerService.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 9e062f4dc1e7..1f3ec2bd1f7e 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -5543,6 +5543,7 @@ class PackageManagerService extends IPackageManager.Stub {
}
p = new PackageSetting(name, codePath, resourcePath, pkgFlags);
p.setTimeStamp(codePath.lastModified());
+ p.sharedUser = sharedUser;
if (sharedUser != null) {
p.userId = sharedUser.userId;
} else if (MULTIPLE_APPLICATION_UIDS) {