Don't return /data/data from BuildDataUserCePath() am: aafc1bfb73 am: 50cfdadab0 am: e515951101

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2095483

Change-Id: Ia19d6556ce520e0a8364001de8bb4314f339241e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Eric Biggers 2022-05-12 20:16:34 +00:00 committed by Automerger Merge Worker
commit af5e9ca469

View file

@ -1160,14 +1160,6 @@ std::string BuildDataMiscDePath(const std::string& volumeUuid, userid_t userId)
std::string BuildDataUserCePath(const std::string& volumeUuid, userid_t userId) { std::string BuildDataUserCePath(const std::string& volumeUuid, userid_t userId) {
// TODO: unify with installd path generation logic // TODO: unify with installd path generation logic
std::string data(BuildDataPath(volumeUuid)); std::string data(BuildDataPath(volumeUuid));
if (volumeUuid.empty() && userId == 0) {
std::string legacy = StringPrintf("%s/data", data.c_str());
struct stat sb;
if (lstat(legacy.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode)) {
/* /data/data is dir, return /data/data for legacy system */
return legacy;
}
}
return StringPrintf("%s/user/%u", data.c_str(), userId); return StringPrintf("%s/user/%u", data.c_str(), userId);
} }