diff options
author | Paul Lawrence <paullawrence@google.com> | 2015-07-15 23:13:24 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-15 23:13:24 +0000 |
commit | a0a0ebc5bb1a009ecb4faac529fa2252568eda33 (patch) | |
tree | 8f39cb7bcac67d622b4b0cf5e815e5c819c13ae3 | |
parent | 5e191823c9d2e9e3309e24d63bc8d8058da3f9f7 (diff) | |
parent | 65df483af2efcb2ab9fd82ae53f9aeaa55f0cebd (diff) | |
download | extras-a0a0ebc5bb1a009ecb4faac529fa2252568eda33.tar.gz |
am 65df483a: Don\'t encrypt lost+found
* commit '65df483af2efcb2ab9fd82ae53f9aeaa55f0cebd':
Don't encrypt lost+found
-rw-r--r-- | ext4_utils/ext4_crypt_init_extensions.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext4_utils/ext4_crypt_init_extensions.cpp b/ext4_utils/ext4_crypt_init_extensions.cpp index 6e8695e8..9b687e80 100644 --- a/ext4_utils/ext4_crypt_init_extensions.cpp +++ b/ext4_utils/ext4_crypt_init_extensions.cpp @@ -142,6 +142,12 @@ int e4crypt_set_directory_policy(const char* dir) if (!dir || strncmp(dir, "/data/", 6) || strchr(dir + 6, '/')) { return 0; } + + // Don't encrypt lost+found - ext4 doesn't like it + if (strcmp(dir, "/data/lost+found")) { + return 0; + } + // ext4enc:TODO exclude /data/user with a horrible special case. if (!strcmp(dir, "/data/user")) { return 0; @@ -157,8 +163,8 @@ int e4crypt_set_directory_policy(const char* dir) KLOG_INFO(TAG, "Setting policy on %s\n", dir); int result = do_policy_set(dir, policy.c_str(), policy.size()); if (result) { - KLOG_ERROR(TAG, "Setting %s policy on %s failed!\n", - policy.c_str(), dir); + KLOG_ERROR(TAG, "Setting %02x%02x%02x%02x policy on %s failed!\n", + policy[0], policy[1], policy[2], policy[3], dir); return -1; } |