diff options
Diffstat (limited to 'cmds/installd/installd.c')
-rw-r--r-- | cmds/installd/installd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 0c80dac..b4df3a3 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -38,8 +38,8 @@ static int do_install(char **arg, char reply[REPLY_MAX]) static int do_dexopt(char **arg, char reply[REPLY_MAX]) { - /* apk_path, uid, is_public */ - return dexopt(arg[0], atoi(arg[1]), atoi(arg[2])); + /* apk_path, uid, is_public, pkgname */ + return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3]); } static int do_move_dex(char **arg, char reply[REPLY_MAX]) @@ -124,6 +124,11 @@ static int do_linklib(char **arg, char reply[REPLY_MAX]) return linklib(arg[0], arg[1], atoi(arg[2])); } +static int do_idmap(char **arg, char reply[REPLY_MAX]) +{ + return idmap(arg[0], arg[1], atoi(arg[2])); +} + struct cmdinfo { const char *name; unsigned numargs; @@ -133,7 +138,7 @@ struct cmdinfo { struct cmdinfo cmds[] = { { "ping", 0, do_ping }, { "install", 4, do_install }, - { "dexopt", 3, do_dexopt }, + { "dexopt", 4, do_dexopt }, { "movedex", 2, do_move_dex }, { "rmdex", 1, do_rm_dex }, { "remove", 2, do_remove }, @@ -147,6 +152,7 @@ struct cmdinfo cmds[] = { { "linklib", 3, do_linklib }, { "mkuserdata", 4, do_mk_user_data }, { "rmuser", 1, do_rm_user }, + { "idmap", 3, do_idmap }, }; static int readx(int s, void *_buf, int count) @@ -392,7 +398,7 @@ int initialize_directories() { goto fail; } - if (selinux_android_restorecon(android_media_dir.path)) { + if (selinux_android_restorecon(android_media_dir.path, 0)) { goto fail; } @@ -515,6 +521,7 @@ static void drop_privileges() { capdata[CAP_TO_INDEX(CAP_CHOWN)].permitted |= CAP_TO_MASK(CAP_CHOWN); capdata[CAP_TO_INDEX(CAP_SETUID)].permitted |= CAP_TO_MASK(CAP_SETUID); capdata[CAP_TO_INDEX(CAP_SETGID)].permitted |= CAP_TO_MASK(CAP_SETGID); + capdata[CAP_TO_INDEX(CAP_FOWNER)].permitted |= CAP_TO_MASK(CAP_FOWNER); capdata[0].effective = capdata[0].permitted; capdata[1].effective = capdata[1].permitted; |