diff options
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r-- | fs/ecryptfs/main.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 7a11b8ae6644..a78d87d14baf 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -104,10 +104,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry, | |||
104 | inode->i_op = &ecryptfs_dir_iops; | 104 | inode->i_op = &ecryptfs_dir_iops; |
105 | if (S_ISDIR(lower_inode->i_mode)) | 105 | if (S_ISDIR(lower_inode->i_mode)) |
106 | inode->i_fop = &ecryptfs_dir_fops; | 106 | inode->i_fop = &ecryptfs_dir_fops; |
107 | /* TODO: Is there a better way to identify if the inode is | 107 | if (special_file(lower_inode->i_mode)) |
108 | * special? */ | ||
109 | if (S_ISBLK(lower_inode->i_mode) || S_ISCHR(lower_inode->i_mode) || | ||
110 | S_ISFIFO(lower_inode->i_mode) || S_ISSOCK(lower_inode->i_mode)) | ||
111 | init_special_inode(inode, lower_inode->i_mode, | 108 | init_special_inode(inode, lower_inode->i_mode, |
112 | lower_inode->i_rdev); | 109 | lower_inode->i_rdev); |
113 | dentry->d_op = &ecryptfs_dops; | 110 | dentry->d_op = &ecryptfs_dops; |
@@ -211,7 +208,6 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) | |||
211 | char *cipher_name_dst; | 208 | char *cipher_name_dst; |
212 | char *cipher_name_src; | 209 | char *cipher_name_src; |
213 | char *cipher_key_bytes_src; | 210 | char *cipher_key_bytes_src; |
214 | struct crypto_tfm *tmp_tfm; | ||
215 | int cipher_name_len; | 211 | int cipher_name_len; |
216 | 212 | ||
217 | if (!options) { | 213 | if (!options) { |
@@ -308,25 +304,19 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) | |||
308 | = '\0'; | 304 | = '\0'; |
309 | } | 305 | } |
310 | if (!cipher_key_bytes_set) { | 306 | if (!cipher_key_bytes_set) { |
311 | mount_crypt_stat->global_default_cipher_key_size = | 307 | mount_crypt_stat->global_default_cipher_key_size = 0; |
312 | ECRYPTFS_DEFAULT_KEY_BYTES; | ||
313 | ecryptfs_printk(KERN_DEBUG, "Cipher key size was not " | ||
314 | "specified. Defaulting to [%d]\n", | ||
315 | mount_crypt_stat-> | ||
316 | global_default_cipher_key_size); | ||
317 | } | 308 | } |
318 | rc = ecryptfs_process_cipher( | 309 | rc = ecryptfs_process_cipher( |
319 | &tmp_tfm, | ||
320 | &mount_crypt_stat->global_key_tfm, | 310 | &mount_crypt_stat->global_key_tfm, |
321 | mount_crypt_stat->global_default_cipher_name, | 311 | mount_crypt_stat->global_default_cipher_name, |
322 | mount_crypt_stat->global_default_cipher_key_size); | 312 | &mount_crypt_stat->global_default_cipher_key_size); |
323 | if (tmp_tfm) | ||
324 | crypto_free_tfm(tmp_tfm); | ||
325 | if (rc) { | 313 | if (rc) { |
326 | printk(KERN_ERR "Error attempting to initialize cipher [%s] " | 314 | printk(KERN_ERR "Error attempting to initialize cipher [%s] " |
327 | "with key size [%Zd] bytes; rc = [%d]\n", | 315 | "with key size [%Zd] bytes; rc = [%d]\n", |
328 | mount_crypt_stat->global_default_cipher_name, | 316 | mount_crypt_stat->global_default_cipher_name, |
329 | mount_crypt_stat->global_default_cipher_key_size, rc); | 317 | mount_crypt_stat->global_default_cipher_key_size, rc); |
318 | mount_crypt_stat->global_key_tfm = NULL; | ||
319 | mount_crypt_stat->global_auth_tok_key = NULL; | ||
330 | rc = -EINVAL; | 320 | rc = -EINVAL; |
331 | goto out; | 321 | goto out; |
332 | } | 322 | } |