Delete unused code conditional on MANAGE_MISC_DIRS

Since MANAGE_MISC_DIRS is hardcoded to 0, and it always has been, there
is no need to have it in the code.

Test: build
Change-Id: I30a73e67999841271e07dbc3eeb1b8568529a7c3
This commit is contained in:
Eric Biggers 2024-02-27 02:57:55 +00:00
parent 527a52874e
commit d0e9a59885
3 changed files with 0 additions and 17 deletions

View file

@ -44,8 +44,6 @@
#include "android/os/IVold.h" #include "android/os/IVold.h"
#define MANAGE_MISC_DIRS 0
#include <cutils/fs.h> #include <cutils/fs.h>
#include <cutils/properties.h> #include <cutils/properties.h>
@ -907,7 +905,6 @@ bool fscrypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_
if (flags & android::os::IVold::STORAGE_FLAG_DE) { if (flags & android::os::IVold::STORAGE_FLAG_DE) {
// DE_sys key // DE_sys key
auto system_legacy_path = android::vold::BuildDataSystemLegacyPath(user_id); auto system_legacy_path = android::vold::BuildDataSystemLegacyPath(user_id);
auto misc_legacy_path = android::vold::BuildDataMiscLegacyPath(user_id);
auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id); auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id);
// DE_n key // DE_n key
@ -937,11 +934,6 @@ bool fscrypt_prepare_user_storage(const std::string& volume_uuid, userid_t user_
if (volume_uuid.empty()) { if (volume_uuid.empty()) {
if (!prepare_dir(system_legacy_path, 0700, AID_SYSTEM, AID_SYSTEM)) return false; if (!prepare_dir(system_legacy_path, 0700, AID_SYSTEM, AID_SYSTEM)) return false;
#if MANAGE_MISC_DIRS
if (!prepare_dir(misc_legacy_path, 0750, multiuser_get_uid(user_id, AID_SYSTEM),
multiuser_get_uid(user_id, AID_EVERYBODY)))
return false;
#endif
if (!prepare_dir(profiles_de_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false; if (!prepare_dir(profiles_de_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false;
if (!prepare_dir_with_policy(system_de_path, 0770, AID_SYSTEM, AID_SYSTEM, de_policy)) if (!prepare_dir_with_policy(system_de_path, 0770, AID_SYSTEM, AID_SYSTEM, de_policy))
@ -1050,7 +1042,6 @@ bool fscrypt_destroy_user_storage(const std::string& volume_uuid, userid_t user_
if (flags & android::os::IVold::STORAGE_FLAG_DE) { if (flags & android::os::IVold::STORAGE_FLAG_DE) {
// DE_sys key // DE_sys key
auto system_legacy_path = android::vold::BuildDataSystemLegacyPath(user_id); auto system_legacy_path = android::vold::BuildDataSystemLegacyPath(user_id);
auto misc_legacy_path = android::vold::BuildDataMiscLegacyPath(user_id);
auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id); auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id);
// DE_n key // DE_n key
@ -1063,9 +1054,6 @@ bool fscrypt_destroy_user_storage(const std::string& volume_uuid, userid_t user_
res &= destroy_dir(misc_de_path); res &= destroy_dir(misc_de_path);
if (volume_uuid.empty()) { if (volume_uuid.empty()) {
res &= destroy_dir(system_legacy_path); res &= destroy_dir(system_legacy_path);
#if MANAGE_MISC_DIRS
res &= destroy_dir(misc_legacy_path);
#endif
res &= destroy_dir(profiles_de_path); res &= destroy_dir(profiles_de_path);
res &= destroy_dir(system_de_path); res &= destroy_dir(system_de_path);
res &= destroy_dir(vendor_de_path); res &= destroy_dir(vendor_de_path);

View file

@ -1116,10 +1116,6 @@ std::string BuildDataSystemDePath(userid_t userId) {
return StringPrintf("%s/system_de/%u", BuildDataPath("").c_str(), userId); return StringPrintf("%s/system_de/%u", BuildDataPath("").c_str(), userId);
} }
std::string BuildDataMiscLegacyPath(userid_t userId) {
return StringPrintf("%s/misc/user/%u", BuildDataPath("").c_str(), userId);
}
// Keep in sync with installd (frameworks/native/cmds/installd/utils.h) // Keep in sync with installd (frameworks/native/cmds/installd/utils.h)
std::string BuildDataProfilesDePath(userid_t userId) { std::string BuildDataProfilesDePath(userid_t userId) {
return StringPrintf("%s/misc/profiles/cur/%u", BuildDataPath("").c_str(), userId); return StringPrintf("%s/misc/profiles/cur/%u", BuildDataPath("").c_str(), userId);

View file

@ -148,7 +148,6 @@ std::string BuildKeyPath(const std::string& partGuid);
std::string BuildDataSystemLegacyPath(userid_t userid); std::string BuildDataSystemLegacyPath(userid_t userid);
std::string BuildDataSystemCePath(userid_t userid); std::string BuildDataSystemCePath(userid_t userid);
std::string BuildDataSystemDePath(userid_t userid); std::string BuildDataSystemDePath(userid_t userid);
std::string BuildDataMiscLegacyPath(userid_t userid);
std::string BuildDataProfilesDePath(userid_t userid); std::string BuildDataProfilesDePath(userid_t userid);
std::string BuildDataVendorCePath(userid_t userid); std::string BuildDataVendorCePath(userid_t userid);
std::string BuildDataVendorDePath(userid_t userid); std::string BuildDataVendorDePath(userid_t userid);