diff options
author | Paul Crowley <paulcrowley@google.com> | 2015-07-12 18:47:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-12 18:48:01 +0000 |
commit | ccaca5cb8971837afe96f5b2940d266a95efd564 (patch) | |
tree | 28dab85bdb511b6c3d28d2a1cd2716fe72d45b55 | |
parent | b89e81dcb9bfa707912d9e370949b250367b0998 (diff) | |
parent | 15e73f525c38d9ccdf8806a6227e83867b8e259b (diff) | |
download | extras-ccaca5cb8971837afe96f5b2940d266a95efd564.tar.gz |
Merge "Don't apply default encryption to /data/user, it should get per-user encryption." into mnc-dr-dev
-rw-r--r-- | ext4_utils/ext4_crypt_init_extensions.cpp | 5 | ||||
-rw-r--r-- | ext4_utils/unencrypted_properties.cpp | 1 |
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; |