提交 b5cd3397 编写于 作者: A Al Viro

namei: may_follow_link() - lift terminate_walk() on failures into caller

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 ab104923
...@@ -798,7 +798,6 @@ static inline int may_follow_link(struct nameidata *nd) ...@@ -798,7 +798,6 @@ static inline int may_follow_link(struct nameidata *nd)
return 0; return 0;
audit_log_link_denied("follow_link", &nd->stack[0].link); audit_log_link_denied("follow_link", &nd->stack[0].link);
terminate_walk(nd);
return -EACCES; return -EACCES;
} }
...@@ -1980,8 +1979,10 @@ static int trailing_symlink(struct nameidata *nd) ...@@ -1980,8 +1979,10 @@ static int trailing_symlink(struct nameidata *nd)
{ {
const char *s; const char *s;
int error = may_follow_link(nd); int error = may_follow_link(nd);
if (unlikely(error)) if (unlikely(error)) {
terminate_walk(nd);
return error; return error;
}
nd->flags |= LOOKUP_PARENT; nd->flags |= LOOKUP_PARENT;
nd->stack[0].name = NULL; nd->stack[0].name = NULL;
s = get_link(nd); s = get_link(nd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册