Modify installd's restorecon function.
Changes above with PMS and below with libselinux
have resulted in a few changes to the restorecon data
api. This change is needed in order to support the new
way to issue a recursive restorecon of certain
/data/data directories.
The restorecondata function has also been modified to
find all users on the device for a given package name
(argument to the function) and to issue a separate
recursive restorecon call for each.
Change-Id: Ie440cba2c96f0907458086348197e1506d31c1b6
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index a080ee6..a078e1c 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -129,10 +129,10 @@
return idmap(arg[0], arg[1], atoi(arg[2]));
}
-static int do_restorecon_data(char **arg __attribute__((unused)),
- char reply[REPLY_MAX] __attribute__((unused)))
+static int do_restorecon_data(char **arg, char reply[REPLY_MAX] __attribute__((unused)))
{
- return restorecon_data();
+ return restorecon_data(arg[0], arg[1], atoi(arg[2]));
+ /* pkgName, seinfo, uid*/
}
struct cmdinfo {
@@ -159,7 +159,7 @@
{ "mkuserdata", 4, do_mk_user_data },
{ "rmuser", 1, do_rm_user },
{ "idmap", 3, do_idmap },
- { "restorecondata", 0, do_restorecon_data },
+ { "restorecondata", 3, do_restorecon_data },
};
static int readx(int s, void *_buf, int count)