From 8ac2a648b6c12c15bb1a62c8f827dabf0ced9704 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Mon, 8 Sep 2014 15:51:55 -0400 Subject: [PATCH] Fix relabeling of secondary user package directories. When relabeling secondary user package directories, we need to use the uid of the directory rather than the primary package UID; otherwise, levelFrom=user will not work correctly. Change-Id: I0d76ec6ec6fe56a566023ca5e1398efdf28fc81e Signed-off-by: Stephen Smalley --- cmds/installd/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index a347fa81a..7a0ad2a48 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -1518,7 +1518,7 @@ int restorecon_data(const char* pkgName, const char* seinfo, uid_t uid) continue; } - if (selinux_android_restorecon_pkgdir(pkgdir, seinfo, uid, flags) < 0) { + if (selinux_android_restorecon_pkgdir(pkgdir, seinfo, s.st_uid, flags) < 0) { ALOGE("restorecon failed for %s: %s\n", pkgdir, strerror(errno)); ret |= -1; }