diff options
author | lijiazi <lijiazi@xiaomi.com> | 2021-05-04 12:00:57 +0800 |
---|---|---|
committer | jiazi li <lijiazi@xiaomi.com> | 2021-05-04 08:37:24 +0000 |
commit | e99ee4904d8c77ecef97589c81f89a9e174214ef (patch) | |
tree | 34d1dac3ae9939919347ca3519dc3a6dc5057b33 | |
parent | 0c40b2bbcfeee9f52e3857a0d4f517d3a6d658a6 (diff) | |
download | selinux-e99ee4904d8c77ecef97589c81f89a9e174214ef.tar.gz |
selinux: remove last slash in CE dirs macro
With this slash, in selinux_android_restorecon_common while loop,
fts_read need to traverse to "/data/system_ce/0" to satisfy the
conditions of skip CE.
If this dir's hash changed in this OTA, new hash will update to
xattr of dir's inode without restorecon for this dir.
When vold installed CE key, and want to restorecon for this dir,
hash match check return true, and dir will be skipped again.
This results in this dir cannot get correct context.
Remove last slash will make skip CE condition satisfy when traverse
"data/system_ce", without update "data/system_ce/0" hash.
Vold can check not match and correct restorecon "data/system_ce/0".
Test: OTA with CE dir contexts changed.
Change-Id: If6aacbe782636acac6cde1517619d8da85143436
Signed-off-by: lijiazi <lijiazi@xiaomi.com>
-rw-r--r-- | libselinux/src/android/android_platform.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libselinux/src/android/android_platform.c b/libselinux/src/android/android_platform.c index 2ffe4155..2e52c153 100644 --- a/libselinux/src/android/android_platform.c +++ b/libselinux/src/android/android_platform.c @@ -1179,9 +1179,9 @@ struct pkg_info *package_info_lookup(const char *name) * credentials are presented (filenames inside are mangled), so we need * to delay restorecon of those until vold explicitly requests it. */ // NOTE: these paths need to be kept in sync with vold -#define DATA_SYSTEM_CE_PREFIX "/data/system_ce/" -#define DATA_VENDOR_CE_PREFIX "/data/vendor_ce/" -#define DATA_MISC_CE_PREFIX "/data/misc_ce/" +#define DATA_SYSTEM_CE_PREFIX "/data/system_ce" +#define DATA_VENDOR_CE_PREFIX "/data/vendor_ce" +#define DATA_MISC_CE_PREFIX "/data/misc_ce" /* The path prefixes of package data directories. */ #define DATA_DATA_PATH "/data/data" |