From f62d2851a83f6976e22932e09c35013a6bb0c3f3 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 12 Dec 2012 10:38:54 -0800 Subject: [PATCH] remove unused code. Change-Id: Iacc8b2664a0e404dfa554f223a44126c41581ae4 --- cmds/installd/commands.c | 47 ---------------------------------------- cmds/installd/installd.c | 6 ----- cmds/installd/installd.h | 1 - 3 files changed, 54 deletions(-) diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 2a547102e..c272e47b3 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -283,53 +283,6 @@ int delete_persona(uid_t persona) return 0; } -int clone_persona_data(uid_t src_persona, uid_t target_persona, int copy) -{ - char src_data_dir[PKG_PATH_MAX]; - char pkg_path[PKG_PATH_MAX]; - DIR *d; - struct dirent *de; - struct stat s; - uid_t uid; - - if (create_persona_path(src_data_dir, src_persona)) { - return -1; - } - - d = opendir(src_data_dir); - if (d != NULL) { - while ((de = readdir(d))) { - const char *name = de->d_name; - - if (de->d_type == DT_DIR) { - int subfd; - /* always skip "." and ".." */ - if (name[0] == '.') { - if (name[1] == 0) continue; - if ((name[1] == '.') && (name[2] == 0)) continue; - } - /* Create the full path to the package's data dir */ - create_pkg_path(pkg_path, name, PKG_DIR_POSTFIX, src_persona); - /* Get the file stat */ - if (stat(pkg_path, &s) < 0) continue; - /* Get the uid of the package */ - ALOGI("Adding datadir for uid = %lu\n", s.st_uid); - uid = (uid_t) s.st_uid % PER_USER_RANGE; - /* Create the directory for the target */ - make_user_data(name, uid + target_persona * PER_USER_RANGE, - target_persona); - } - } - closedir(d); - } - - if (ensure_media_user_dirs((userid_t) target_persona) == -1) { - return -1; - } - - return 0; -} - int delete_cache(const char *pkgname, uid_t persona) { char cachedir[PKG_PATH_MAX]; diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 21d674a03..2285e79fc 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -111,11 +111,6 @@ static int do_rm_user(char **arg, char reply[REPLY_MAX]) return delete_persona(atoi(arg[0])); /* userid */ } -static int do_clone_user_data(char **arg, char reply[REPLY_MAX]) -{ - return clone_persona_data(atoi(arg[0]), atoi(arg[1]), atoi(arg[2])); -} - static int do_movefiles(char **arg, char reply[REPLY_MAX]) { return movefiles(); @@ -149,7 +144,6 @@ struct cmdinfo cmds[] = { { "linklib", 3, do_linklib }, { "mkuserdata", 3, do_mk_user_data }, { "rmuser", 1, do_rm_user }, - { "cloneuserdata", 3, do_clone_user_data }, }; static int readx(int s, void *_buf, int count) diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index 0500c23fa..efd3aa7db 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -199,7 +199,6 @@ int fix_uid(const char *pkgname, uid_t uid, gid_t gid); 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, uid_t persona); int move_dex(const char *src, const char *dst); int rm_dex(const char *path);