Merge "remove unused code."
This commit is contained in:
commit
603b6c1975
@ -283,53 +283,6 @@ int delete_persona(uid_t persona)
|
|||||||
return 0;
|
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)
|
int delete_cache(const char *pkgname, uid_t persona)
|
||||||
{
|
{
|
||||||
char cachedir[PKG_PATH_MAX];
|
char cachedir[PKG_PATH_MAX];
|
||||||
|
@ -111,11 +111,6 @@ static int do_rm_user(char **arg, char reply[REPLY_MAX])
|
|||||||
return delete_persona(atoi(arg[0])); /* userid */
|
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])
|
static int do_movefiles(char **arg, char reply[REPLY_MAX])
|
||||||
{
|
{
|
||||||
return movefiles();
|
return movefiles();
|
||||||
@ -149,7 +144,6 @@ struct cmdinfo cmds[] = {
|
|||||||
{ "linklib", 3, do_linklib },
|
{ "linklib", 3, do_linklib },
|
||||||
{ "mkuserdata", 3, do_mk_user_data },
|
{ "mkuserdata", 3, do_mk_user_data },
|
||||||
{ "rmuser", 1, do_rm_user },
|
{ "rmuser", 1, do_rm_user },
|
||||||
{ "cloneuserdata", 3, do_clone_user_data },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int readx(int s, void *_buf, int count)
|
static int readx(int s, void *_buf, int count)
|
||||||
|
@ -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 delete_user_data(const char *pkgname, uid_t persona);
|
||||||
int make_user_data(const char *pkgname, uid_t uid, uid_t persona);
|
int make_user_data(const char *pkgname, uid_t uid, uid_t persona);
|
||||||
int delete_persona(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 delete_cache(const char *pkgname, uid_t persona);
|
||||||
int move_dex(const char *src, const char *dst);
|
int move_dex(const char *src, const char *dst);
|
||||||
int rm_dex(const char *path);
|
int rm_dex(const char *path);
|
||||||
|
Loading…
Reference in New Issue
Block a user