diff options
author | Amith Yamasani <yamasani@google.com> | 2012-10-01 10:39:14 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2012-10-01 11:19:55 -0700 |
commit | 54289b8b4a110cc1ae106d79785cc762a2aebd6e (patch) | |
tree | a414077d404f27aa8643ef1516ad9829b6fc214d /cmds/installd | |
parent | c56e5600501a5c376dc13e6a99fcec7782fc8718 (diff) | |
download | frameworks_base-54289b8b4a110cc1ae106d79785cc762a2aebd6e.zip frameworks_base-54289b8b4a110cc1ae106d79785cc762a2aebd6e.tar.gz frameworks_base-54289b8b4a110cc1ae106d79785cc762a2aebd6e.tar.bz2 |
Fix cache deletion for secondary users
Bug: 7249419
Change-Id: Idbc0f9994508059ebf5055aea961b87e08b3673a
Diffstat (limited to 'cmds/installd')
-rw-r--r-- | cmds/installd/commands.c | 4 | ||||
-rw-r--r-- | cmds/installd/installd.c | 4 | ||||
-rw-r--r-- | cmds/installd/installd.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 396771f..a276225 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -271,11 +271,11 @@ int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy) return 0; } -int delete_cache(const char *pkgname) +int delete_cache(const char *pkgname, uid_t persona) { char cachedir[PKG_PATH_MAX]; - if (create_pkg_path(cachedir, pkgname, CACHE_DIR_POSTFIX, 0)) + if (create_pkg_path(cachedir, pkgname, CACHE_DIR_POSTFIX, persona)) return -1; /* delete contents, not the directory, no exceptions */ diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index a099537..19298a3 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -72,7 +72,7 @@ static int do_free_cache(char **arg, char reply[REPLY_MAX]) /* TODO int:free_siz static int do_rm_cache(char **arg, char reply[REPLY_MAX]) { - return delete_cache(arg[0]); /* pkgname */ + return delete_cache(arg[0], atoi(arg[1])); /* pkgname, userid */ } static int do_get_size(char **arg, char reply[REPLY_MAX]) @@ -142,7 +142,7 @@ struct cmdinfo cmds[] = { { "rename", 2, do_rename }, { "fixuid", 3, do_fixuid }, { "freecache", 1, do_free_cache }, - { "rmcache", 1, do_rm_cache }, + { "rmcache", 2, do_rm_cache }, { "getsize", 5, do_get_size }, { "rmuserdata", 2, do_rm_user_data }, { "movefiles", 0, do_movefiles }, diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index a229b97..2540dbe 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -199,7 +199,7 @@ int delete_user_data(const char *pkgname, uid_t persona); int make_user_data(const char *pkgname, uid_t uid, uid_t persona); int delete_persona(uid_t persona); int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy); -int delete_cache(const char *pkgname); +int delete_cache(const char *pkgname, uid_t persona); int move_dex(const char *src, const char *dst); int rm_dex(const char *path); int protect(char *pkgname, gid_t gid); |