diff options
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r-- | fs/ecryptfs/crypto.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 75bee99de0f6..8b65f289ee00 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -2221,17 +2221,19 @@ int ecryptfs_decode_and_decrypt_filename(char **plaintext_name, | |||
2221 | struct dentry *ecryptfs_dir_dentry, | 2221 | struct dentry *ecryptfs_dir_dentry, |
2222 | const char *name, size_t name_size) | 2222 | const char *name, size_t name_size) |
2223 | { | 2223 | { |
2224 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = | ||
2225 | &ecryptfs_superblock_to_private( | ||
2226 | ecryptfs_dir_dentry->d_sb)->mount_crypt_stat; | ||
2224 | char *decoded_name; | 2227 | char *decoded_name; |
2225 | size_t decoded_name_size; | 2228 | size_t decoded_name_size; |
2226 | size_t packet_size; | 2229 | size_t packet_size; |
2227 | int rc = 0; | 2230 | int rc = 0; |
2228 | 2231 | ||
2229 | if ((name_size > ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) | 2232 | if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) |
2233 | && !(mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) | ||
2234 | && (name_size > ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) | ||
2230 | && (strncmp(name, ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX, | 2235 | && (strncmp(name, ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX, |
2231 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) == 0)) { | 2236 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) == 0)) { |
2232 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = | ||
2233 | &ecryptfs_superblock_to_private( | ||
2234 | ecryptfs_dir_dentry->d_sb)->mount_crypt_stat; | ||
2235 | const char *orig_name = name; | 2237 | const char *orig_name = name; |
2236 | size_t orig_name_size = name_size; | 2238 | size_t orig_name_size = name_size; |
2237 | 2239 | ||