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
Kirill Smelkov
linux
Commits
fec2fa24
Commit
fec2fa24
authored
May 06, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
may_follow_link(): trim arguments
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
cd179f44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
fs/namei.c
fs/namei.c
+5
-6
No files found.
fs/namei.c
View file @
fec2fa24
...
...
@@ -765,7 +765,6 @@ int sysctl_protected_hardlinks __read_mostly = 0;
/**
* may_follow_link - Check symlink following for unsafe situations
* @link: The path of the symlink
* @nd: nameidata pathwalk data
*
* In the case of the sysctl_protected_symlinks sysctl being enabled,
...
...
@@ -779,7 +778,7 @@ int sysctl_protected_hardlinks __read_mostly = 0;
*
* Returns 0 if following the symlink is allowed, -ve on error.
*/
static
inline
int
may_follow_link
(
struct
path
*
link
,
struct
nameidata
*
nd
)
static
inline
int
may_follow_link
(
struct
nameidata
*
nd
)
{
const
struct
inode
*
inode
;
const
struct
inode
*
parent
;
...
...
@@ -788,7 +787,7 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
return
0
;
/* Allowed if owner and follower match. */
inode
=
link
->
dentry
->
d_inode
;
inode
=
nd
->
link
.
dentry
->
d_inode
;
if
(
uid_eq
(
current_cred
()
->
fsuid
,
inode
->
i_uid
))
return
0
;
...
...
@@ -801,8 +800,8 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
if
(
uid_eq
(
parent
->
i_uid
,
inode
->
i_uid
))
return
0
;
audit_log_link_denied
(
"follow_link"
,
link
);
path_put
(
link
);
audit_log_link_denied
(
"follow_link"
,
&
nd
->
link
);
path_put
(
&
nd
->
link
);
path_put
(
&
nd
->
path
);
return
-
EACCES
;
}
...
...
@@ -1985,7 +1984,7 @@ static void path_cleanup(struct nameidata *nd)
static
int
trailing_symlink
(
struct
nameidata
*
nd
)
{
const
char
*
s
;
int
error
=
may_follow_link
(
&
nd
->
link
,
nd
);
int
error
=
may_follow_link
(
nd
);
if
(
unlikely
(
error
))
return
error
;
nd
->
flags
|=
LOOKUP_PARENT
;
...
...
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