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 <sds@tycho.nsa.gov>
This commit is contained in:
Stephen Smalley 2014-09-08 15:51:55 -04:00
parent 8c1642ad4e
commit 8ac2a648b6

View File

@ -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;
}