From f11a339bb2d9e501d9d4d16b2e97d5bcb48fc760 Mon Sep 17 00:00:00 2001 From: steven_q Date: Thu, 20 Jan 2022 15:51:28 +0800 Subject: [PATCH] hap restorecon error while reboot Signed-off-by: steven_q --- libselinux/src/selinux_restorecon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c index 87b3a090..191af16f 100644 --- a/libselinux/src/selinux_restorecon.c +++ b/libselinux/src/selinux_restorecon.c @@ -609,9 +609,14 @@ static int restorecon_sb(const char *pathname, const struct stat *sb, bool updated = false; const char *lookup_path = pathname; float pc; - if (!strncmp(pathname, "/data/app/", sizeof("/data/app/") - 1)) { + if (!strncmp(pathname, "/data/app/el1/", sizeof("/data/app/el1/") - 1) || + !strncmp(pathname, "/data/app/el2/", sizeof("/data/app/el2/") - 1) || + !strncmp(pathname, "/data/app/el3/", sizeof("/data/app/el3/") - 1) || + !strncmp(pathname, "/data/app/el4/", sizeof("/data/app/el4/") - 1) || + !strncmp(pathname, "/data/accounts/account_0/", sizeof("/data/accounts/account_0/") - 1)) { goto out; } + if (rootpath) { if (strncmp(rootpath, lookup_path, rootpathlen) != 0) { selinux_log(SELINUX_ERROR, -- Gitee