summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2012-09-08 17:03:48 -0700
committerKenny Root <kroot@google.com>2012-09-09 12:12:43 -0700
commit0c191624fba8484e811027a9db40a62a960ab7dc (patch)
tree58c22c2bb7a920b6740da3e3268ebff01a308f80 /cmds
parentadd52a975aa78d9e24d3e63a8168c00a9bfb80ec (diff)
downloadframeworks_base-0c191624fba8484e811027a9db40a62a960ab7dc.zip
frameworks_base-0c191624fba8484e811027a9db40a62a960ab7dc.tar.gz
frameworks_base-0c191624fba8484e811027a9db40a62a960ab7dc.tar.bz2
Remove "protect" command from installd
No one uses the "protect" command anymore, so remove it from installd. Change-Id: Ia990bae6f95cd6e317496f5dd173ec15164d7164
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/commands.c31
-rw-r--r--cmds/installd/installd.c6
2 files changed, 0 insertions, 37 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 697d8ec..68f8400 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -403,37 +403,6 @@ int rm_dex(const char *path)
}
}
-int protect(char *pkgname, gid_t gid)
-{
- struct stat s;
- char pkgpath[PKG_PATH_MAX];
-
- if (gid < AID_SYSTEM) return -1;
-
- if (create_pkg_path_in_dir(pkgpath, &android_app_private_dir, pkgname, ".apk"))
- return -1;
-
- if (stat(pkgpath, &s) < 0) return -1;
-
- if (chown(pkgpath, s.st_uid, gid) < 0) {
- ALOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno));
- return -1;
- }
- if (chmod(pkgpath, S_IRUSR|S_IWUSR|S_IRGRP) < 0) {
- ALOGE("protect(): failed to chmod '%s': %s\n", pkgpath, strerror(errno));
- return -1;
- }
-
-#ifdef HAVE_SELINUX
- if (selinux_android_setfilecon(pkgpath, pkgname, s.st_uid) < 0) {
- ALOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno));
- return -1;
- }
-#endif
-
- return 0;
-}
-
int get_size(const char *pkgname, int persona, const char *apkpath,
const char *fwdlock_apkpath, const char *asecpath,
int64_t *_codesize, int64_t *_datasize, int64_t *_cachesize,
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 652543fd..cc8f014 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -75,11 +75,6 @@ static int do_rm_cache(char **arg, char reply[REPLY_MAX])
return delete_cache(arg[0]); /* pkgname */
}
-static int do_protect(char **arg, char reply[REPLY_MAX])
-{
- return protect(arg[0], atoi(arg[1])); /* pkgname, gid */
-}
-
static int do_get_size(char **arg, char reply[REPLY_MAX])
{
int64_t codesize = 0;
@@ -153,7 +148,6 @@ struct cmdinfo cmds[] = {
{ "fixuid", 3, do_fixuid },
{ "freecache", 1, do_free_cache },
{ "rmcache", 1, do_rm_cache },
- { "protect", 2, do_protect },
{ "getsize", 5, do_get_size },
{ "rmuserdata", 2, do_rm_user_data },
{ "movefiles", 0, do_movefiles },