summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Crowley <paulcrowley@google.com>2015-07-13 15:11:35 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-13 15:11:35 +0000
commit3b10d6195ad6d147d32306f734a64e50a51bbccd (patch)
treee650931d6cbab6062282ae77ef83a4cdb8e26090
parent830175fa76fea6dff1fc2e79adebfb515b9da993 (diff)
parentccaca5cb8971837afe96f5b2940d266a95efd564 (diff)
downloadextras-3b10d6195ad6d147d32306f734a64e50a51bbccd.tar.gz
am ccaca5cb: Merge "Don\'t apply default encryption to /data/user, it should get per-user encryption." into mnc-dr-dev
* commit 'ccaca5cb8971837afe96f5b2940d266a95efd564': Don't apply default encryption to /data/user, it should get per-user encryption.
-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;