mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
namei: may_follow_link() - lift terminate_walk() on failures into caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
ab10492345
commit
b5cd339762
1 changed files with 3 additions and 2 deletions
|
@ -798,7 +798,6 @@ static inline int may_follow_link(struct nameidata *nd)
|
|||
return 0;
|
||||
|
||||
audit_log_link_denied("follow_link", &nd->stack[0].link);
|
||||
terminate_walk(nd);
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
|
@ -1980,8 +1979,10 @@ static int trailing_symlink(struct nameidata *nd)
|
|||
{
|
||||
const char *s;
|
||||
int error = may_follow_link(nd);
|
||||
if (unlikely(error))
|
||||
if (unlikely(error)) {
|
||||
terminate_walk(nd);
|
||||
return error;
|
||||
}
|
||||
nd->flags |= LOOKUP_PARENT;
|
||||
nd->stack[0].name = NULL;
|
||||
s = get_link(nd);
|
||||
|
|
Loading…
Reference in a new issue