libpackagelistparser: export profileable_from_shell flag.

Bug: 118835348
Test: test manually on apps that the flag is set properly.
Change-Id: Idd86dca6c7d767be985bb27f4dd3116d79029868
This commit is contained in:
Yabin Cui 2019-01-10 16:24:20 -08:00
parent 37b5edf61b
commit b9fcfc8b98
2 changed files with 18 additions and 0 deletions

View file

@ -53,6 +53,7 @@ struct pkg_info {
char *seinfo;
gid_list gids;
void *private_data;
bool profileable_from_shell;
};
/**

View file

@ -223,6 +223,23 @@ extern bool packagelist_parse(pfn_on_package callback, void *userdata)
}
}
cur = strsep(&next, " \t\r\n");
if (cur) {
tmp = strtoul(cur, &endptr, 10);
if (*endptr != '\0') {
errmsg = "Could not convert field \"profileable_from_shell\" to integer value";
goto err;
}
/* should be a valid boolean of 1 or 0 */
if (!(tmp == 0 || tmp == 1)) {
errmsg = "Field \"profileable_from_shell\" is not 0 or 1 boolean value";
goto err;
}
pkg_info->profileable_from_shell = (bool)tmp;
}
rc = callback(pkg_info, userdata);
if (rc == false) {
/*