restorecon top-level entries under /data/user.
/data/user has a set of top-level entries including the /data/user/0
symlink and the /data/user/N subdirectories for secondary users that
need to be relabeled on upgrades from 4.2 with unlabeled userdata.
Only set the flag to skip on subdirectories of /data/user, not on
/data/user itself.
Change-Id: I7a4c7ede74daa249db654963ba49585755c9b04e
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
diff --git a/src/android.c b/src/android.c
index 18c5da9..02ac063 100644
--- a/src/android.c
+++ b/src/android.c
@@ -1178,7 +1178,7 @@
}
if (!datadata &&
(!strcmp(ftsent->fts_path, DATA_DATA_PATH) ||
- !strcmp(ftsent->fts_path, DATA_USER_PATH))) {
+ !strncmp(ftsent->fts_path, DATA_USER_PREFIX, sizeof(DATA_USER_PREFIX)-1))) {
// Don't label anything below this directory.
fts_set(fts, ftsent, FTS_SKIP);
// but fall through and make sure we label the directory itself