Revert "kernel: add package whitelist check for manager APKs"
This commit is contained in:
@@ -62,8 +62,14 @@ static int get_pkg_from_apk_path(char *pkg, const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void crown_manager(const char *apk, char *pkg, struct list_head *uid_data)
|
||||
static void crown_manager(const char *apk, struct list_head *uid_data)
|
||||
{
|
||||
char pkg[KSU_MAX_PACKAGE_NAME];
|
||||
if (get_pkg_from_apk_path(pkg, apk) < 0) {
|
||||
pr_err("Failed to get package name from apk path: %s\n", apk);
|
||||
return;
|
||||
}
|
||||
|
||||
pr_info("manager pkg: %s\n", pkg);
|
||||
|
||||
#ifdef KSU_MANAGER_PACKAGE
|
||||
@@ -170,7 +176,6 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
||||
} else {
|
||||
if ((namelen == 8) && (strncmp(name, "base.apk", namelen) == 0)) {
|
||||
struct apk_path_hash *pos;
|
||||
char pkg[KSU_MAX_PACKAGE_NAME];
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||
unsigned int hash = full_name_hash(dirpath, strlen(dirpath));
|
||||
#else
|
||||
@@ -183,16 +188,11 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
||||
}
|
||||
}
|
||||
|
||||
if (get_pkg_from_apk_path(pkg, dirpath) < 0) {
|
||||
pr_err("Failed to get package name from apk path: %s\n", dirpath);
|
||||
return FILLDIR_ACTOR_CONTINUE;
|
||||
}
|
||||
|
||||
bool is_manager = is_manager_apk(dirpath, pkg);
|
||||
bool is_manager = is_manager_apk(dirpath);
|
||||
pr_info("Found new base.apk at path: %s, is_manager: %d\n",
|
||||
dirpath, is_manager);
|
||||
if (is_manager) {
|
||||
crown_manager(dirpath, pkg, my_ctx->private_data);
|
||||
crown_manager(dirpath, my_ctx->private_data);
|
||||
*my_ctx->stop = 1;
|
||||
}
|
||||
}
|
||||
@@ -394,4 +394,4 @@ void ksu_throne_tracker_init()
|
||||
void ksu_throne_tracker_exit()
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user