summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Crowley <paulcrowley@google.com>2015-05-06 15:28:35 +0100
committerPaul Crowley <paulcrowley@google.com>2015-07-09 18:08:41 +0100
commit15e73f525c38d9ccdf8806a6227e83867b8e259b (patch)
tree235506397a9f08f438fb6061c790ced48bdd7a8c
parent833eaf66268bd4a2e5535f9b203f3d7c0085baa6 (diff)
downloadandroid_system_extras-15e73f525c38d9ccdf8806a6227e83867b8e259b.tar.gz
android_system_extras-15e73f525c38d9ccdf8806a6227e83867b8e259b.tar.bz2
android_system_extras-15e73f525c38d9ccdf8806a6227e83867b8e259b.zip
Don't apply default encryption to /data/user, it should get per-user
encryption. Bug: 19704432 (cherry-picked from commit 0050336a0a19019a68374b9eef51e00d6b242f57) Change-Id: I646f3408ccc06f580d62a2f90f7b895288585396
-rw-r--r--ext4_utils/ext4_crypt_init_extensions.cpp5
-rw-r--r--ext4_utils/unencrypted_properties.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/ext4_utils/ext4_crypt_init_extensions.cpp b/ext4_utils/ext4_crypt_init_extensions.cpp
index 3fb04b98..e1b69e1e 100644
--- a/ext4_utils/ext4_crypt_init_extensions.cpp
+++ b/ext4_utils/ext4_crypt_init_extensions.cpp
@@ -142,10 +142,15 @@ int e4crypt_set_directory_policy(const char* dir)
if (!dir || strncmp(dir, "/data/", 6) || strchr(dir + 6, '/')) {
return 0;
}
+ // ext4enc:TODO exclude /data/user with a horrible special case.
+ if (!strcmp(dir, "/data/user")) {
+ return 0;
+ }
UnencryptedProperties props("/data");
std::string policy = props.Get<std::string>(properties::ref);
if (policy.empty()) {
+ // ext4enc:TODO why is this OK?
return 0;
}
diff --git a/ext4_utils/unencrypted_properties.cpp b/ext4_utils/unencrypted_properties.cpp
index d873e91f..ed36e206 100644
--- a/ext4_utils/unencrypted_properties.cpp
+++ b/ext4_utils/unencrypted_properties.cpp
@@ -84,6 +84,7 @@ UnencryptedProperties UnencryptedProperties::GetChild(const char* name) const
bool UnencryptedProperties::Remove(const char* name)
{
+ if (!OK()) return false;
if (remove((folder_ + "/" + name).c_str())
&& errno != ENOENT) {
return false;