summaryrefslogtreecommitdiffstats
path: root/cmds/installd/commands.c
diff options
context:
space:
mode:
authorrpcraig <rpcraig@tycho.ncsc.mil>2012-11-14 10:07:28 -0500
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-07-18 20:56:41 +0100
commite6a337246ee3736727f43ed21a2287a59ed4491c (patch)
tree1263d1093b79d5ff0d38aefab78d214d66252a55 /cmds/installd/commands.c
parent6c33ad36e429b3a3ad69e53275714ca43cdc03fe (diff)
downloadframeworks_base-e6a337246ee3736727f43ed21a2287a59ed4491c.zip
frameworks_base-e6a337246ee3736727f43ed21a2287a59ed4491c.tar.gz
frameworks_base-e6a337246ee3736727f43ed21a2287a59ed4491c.tar.bz2
Add seinfo parsing to PackageManagerService.
This patch set allows the PMS to parse the mac_permissions.xml file which contains the seinfo values. Each package that is installed on the device will be assigned an seinfo value based on policy. This seinfo value will help label the app process and data directory. Modifications also include, adjustments to ApplicationInfo.java to store the seinfo tag per package, adjustments to installd to communicate the seinfo tag to libselinux, and finally a set of unit tests. Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil> Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Diffstat (limited to 'cmds/installd/commands.c')
-rw-r--r--cmds/installd/commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index d19db32..4f6971b 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -32,7 +32,7 @@ dir_rec_t android_app_lib_dir;
dir_rec_t android_media_dir;
dir_rec_array_t android_system_dirs;
-int install(const char *pkgname, uid_t uid, gid_t gid)
+int install(const char *pkgname, uid_t uid, gid_t gid, const char *seinfo)
{
char pkgdir[PKG_PATH_MAX];
char libsymlink[PKG_PATH_MAX];
@@ -96,7 +96,7 @@ int install(const char *pkgname, uid_t uid, gid_t gid)
}
#ifdef HAVE_SELINUX
- if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) {
+ if (selinux_android_setfilecon2(pkgdir, pkgname, seinfo, uid) < 0) {
ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno));
unlink(libsymlink);
unlink(pkgdir);