fscrypt_destroy_user_storage: continue when EnsurePolicy returns false
Change-Id: I8a7d4343a12a7be346b96d27226f83d890a8597a
(cherry picked from commit ffb034ec784c137d96f254fe546ee19acf6bd074)
diff --git a/crypto/fscrypt/FsCrypt.cpp b/crypto/fscrypt/FsCrypt.cpp
index 6284fa8..a2049a2 100755
--- a/crypto/fscrypt/FsCrypt.cpp
+++ b/crypto/fscrypt/FsCrypt.cpp
@@ -875,13 +875,18 @@
EncryptionPolicy de_policy;
if (volume_uuid.empty()) {
if (!lookup_policy(s_de_policies, user_id, &de_policy)) return false;
- if (!EnsurePolicy(de_policy, system_de_path)) return false;
- if (!EnsurePolicy(de_policy, misc_de_path)) return false;
- if (!EnsurePolicy(de_policy, vendor_de_path)) return false;
+ if (!EnsurePolicy(de_policy, system_de_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << system_de_path;
+ if (!EnsurePolicy(de_policy, misc_de_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << misc_de_path;
+ if (!EnsurePolicy(de_policy, vendor_de_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << vendor_de_path;
} else {
if (!read_or_create_volkey(misc_de_path, volume_uuid, &de_policy)) return false;
}
- if (!EnsurePolicy(de_policy, user_de_path)) return false;
+ if (!EnsurePolicy(de_policy, user_de_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << user_de_path;
+
}
}
@@ -906,14 +911,19 @@
EncryptionPolicy ce_policy;
if (volume_uuid.empty()) {
if (!lookup_policy(s_ce_policies, user_id, &ce_policy)) return false;
- if (!EnsurePolicy(ce_policy, system_ce_path)) return false;
- if (!EnsurePolicy(ce_policy, misc_ce_path)) return false;
- if (!EnsurePolicy(ce_policy, vendor_ce_path)) return false;
+ if (!EnsurePolicy(ce_policy, system_ce_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << system_ce_path;
+ if (!EnsurePolicy(ce_policy, misc_ce_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << misc_ce_path;
+ if (!EnsurePolicy(ce_policy, vendor_ce_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << vendor_ce_path;
} else {
if (!read_or_create_volkey(misc_ce_path, volume_uuid, &ce_policy)) return false;
}
- if (!EnsurePolicy(ce_policy, media_ce_path)) return false;
- if (!EnsurePolicy(ce_policy, user_ce_path)) return false;
+ if (!EnsurePolicy(ce_policy, media_ce_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << media_ce_path;
+ if (!EnsurePolicy(ce_policy, user_ce_path))
+ LOG(INFO) << "EnsurePolicy returned false for " << user_ce_path;
}
if (volume_uuid.empty()) {