diff options
author | Stephen Smalley <sds@tycho.nsa.gov> | 2012-11-21 12:54:34 -0500 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-18 21:02:22 +0100 |
commit | b00a063e976fe2f97a3297b769310fc70ca4f699 (patch) | |
tree | 23faa1f835d97a3ed59483bd60929c713a9099f0 /services | |
parent | 36d685c5a72aef502af1b08c7fba921b15edb2a3 (diff) | |
download | frameworks_base-b00a063e976fe2f97a3297b769310fc70ca4f699.zip frameworks_base-b00a063e976fe2f97a3297b769310fc70ca4f699.tar.gz frameworks_base-b00a063e976fe2f97a3297b769310fc70ca4f699.tar.bz2 |
Apply MMAC changes from master.
Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8477e
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/pm/PackageManagerService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 0bf7be9..134619e 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -182,6 +182,8 @@ public class PackageManagerService extends IPackageManager.Stub { private static final boolean DEBUG_PREFERRED = false; static final boolean DEBUG_UPGRADE = false; private static final boolean DEBUG_INSTALL = false; + private static final boolean DEBUG_POLICY = true; + private static final boolean DEBUG_POLICY_INSTALL = DEBUG_POLICY || false; private static final boolean DEBUG_REMOVE = false; private static final boolean DEBUG_BROADCASTS = false; private static final boolean DEBUG_SHOW_INFO = false; @@ -3657,8 +3659,12 @@ public class PackageManagerService extends IPackageManager.Stub { } mScanningPath = scanFile; - if (mFoundPolicyFile) { - SELinuxMMAC.assignSeinfoValue(pkg); + if (mFoundPolicyFile && !SELinuxMMAC.passInstallPolicyChecks(pkg) && + SystemProperties.getBoolean("persist.mac_enforcing_mode", false)) { + Slog.w(TAG, "Installing application package " + pkg.packageName + + " failed due to policy."); + mLastScanError = PackageManager.INSTALL_FAILED_POLICY_REJECTED_PERMISSION; + return null; } if ((parseFlags&PackageParser.PARSE_IS_SYSTEM) != 0) { |