From aafc1bfb7317bbbc50595fdb6d5fd56cd250fbbf Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 11 May 2022 05:33:25 +0000 Subject: [PATCH] Don't return /data/data from BuildDataUserCePath() There is no reason for this function to sometimes return the legacy alias "/data/data" for /data/user/0. Just use /data/user/0 instead. Bug: 156305599 Change-Id: I305a9463c1bf0a59495c34ef33430f92257c2f0d --- Utils.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Utils.cpp b/Utils.cpp index ba6afd8..3757c1f 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -1160,14 +1160,6 @@ std::string BuildDataMiscDePath(const std::string& volumeUuid, userid_t userId) std::string BuildDataUserCePath(const std::string& volumeUuid, userid_t userId) { // TODO: unify with installd path generation logic 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); }