diff options
-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; |