Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0747fdb2
Commit
0747fdb2
authored
Jun 16, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ecryptfs: switch ecryptfs_decode_and_decrypt_filename() from dentry to sb
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
cb5e05d1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
fs/ecryptfs/crypto.c
fs/ecryptfs/crypto.c
+2
-3
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/ecryptfs_kernel.h
+1
-1
fs/ecryptfs/file.c
fs/ecryptfs/file.c
+4
-5
fs/ecryptfs/inode.c
fs/ecryptfs/inode.c
+1
-1
No files found.
fs/ecryptfs/crypto.c
View file @
0747fdb2
...
...
@@ -2243,12 +2243,11 @@ int ecryptfs_encrypt_and_encode_filename(
*/
int
ecryptfs_decode_and_decrypt_filename
(
char
**
plaintext_name
,
size_t
*
plaintext_name_size
,
struct
dentry
*
ecryptfs_dir_dentry
,
struct
super_block
*
sb
,
const
char
*
name
,
size_t
name_size
)
{
struct
ecryptfs_mount_crypt_stat
*
mount_crypt_stat
=
&
ecryptfs_superblock_to_private
(
ecryptfs_dir_dentry
->
d_sb
)
->
mount_crypt_stat
;
&
ecryptfs_superblock_to_private
(
sb
)
->
mount_crypt_stat
;
char
*
decoded_name
;
size_t
decoded_name_size
;
size_t
packet_size
;
...
...
fs/ecryptfs/ecryptfs_kernel.h
View file @
0747fdb2
...
...
@@ -575,7 +575,7 @@ int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry,
struct
inode
*
ecryptfs_inode
);
int
ecryptfs_decode_and_decrypt_filename
(
char
**
decrypted_name
,
size_t
*
decrypted_name_size
,
struct
dentry
*
ecryptfs_dentry
,
struct
super_block
*
sb
,
const
char
*
name
,
size_t
name_size
);
int
ecryptfs_fill_zeros
(
struct
file
*
file
,
loff_t
new_length
);
int
ecryptfs_encrypt_and_encode_filename
(
...
...
fs/ecryptfs/file.c
View file @
0747fdb2
...
...
@@ -70,7 +70,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
struct
ecryptfs_getdents_callback
{
struct
dir_context
ctx
;
struct
dir_context
*
caller
;
struct
dentry
*
dentry
;
struct
super_block
*
sb
;
int
filldir_called
;
int
entries_written
;
};
...
...
@@ -88,7 +88,7 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen,
buf
->
filldir_called
++
;
rc
=
ecryptfs_decode_and_decrypt_filename
(
&
name
,
&
name_size
,
buf
->
dentry
,
lower_name
,
buf
->
sb
,
lower_name
,
lower_namelen
);
if
(
rc
)
{
printk
(
KERN_ERR
"%s: Error attempting to decode and decrypt "
...
...
@@ -114,15 +114,14 @@ static int ecryptfs_readdir(struct file *file, struct dir_context *ctx)
{
int
rc
;
struct
file
*
lower_file
;
struct
inode
*
inode
;
struct
inode
*
inode
=
file_inode
(
file
)
;
struct
ecryptfs_getdents_callback
buf
=
{
.
ctx
.
actor
=
ecryptfs_filldir
,
.
caller
=
ctx
,
.
dentry
=
file
->
f_path
.
dentry
.
sb
=
inode
->
i_sb
,
};
lower_file
=
ecryptfs_file_to_lower
(
file
);
lower_file
->
f_pos
=
ctx
->
pos
;
inode
=
file_inode
(
file
);
rc
=
iterate_dir
(
lower_file
,
&
buf
.
ctx
);
ctx
->
pos
=
buf
.
ctx
.
pos
;
if
(
rc
<
0
)
...
...
fs/ecryptfs/inode.c
View file @
0747fdb2
...
...
@@ -679,7 +679,7 @@ static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf,
set_fs
(
old_fs
);
if
(
rc
<
0
)
goto
out
;
rc
=
ecryptfs_decode_and_decrypt_filename
(
buf
,
bufsiz
,
dentry
,
rc
=
ecryptfs_decode_and_decrypt_filename
(
buf
,
bufsiz
,
dentry
->
d_sb
,
lower_buf
,
rc
);
out:
kfree
(
lower_buf
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment