diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-08 16:38:31 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-10 22:20:20 -0400 |
commit | b5cd3397627ab7e200ee068ca39b9ca2d031f26d (patch) | |
tree | a923b90c4be1bb31c570658a68dfafd7a176794a /fs/namei.c | |
parent | ab10492345d1d629743c7e7d56532f4e5284c2c5 (diff) |
namei: may_follow_link() - lift terminate_walk() on failures into caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 6d4692d772f7..51e2214e820d 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -798,7 +798,6 @@ static inline int may_follow_link(struct nameidata *nd) | |||
798 | return 0; | 798 | return 0; |
799 | 799 | ||
800 | audit_log_link_denied("follow_link", &nd->stack[0].link); | 800 | audit_log_link_denied("follow_link", &nd->stack[0].link); |
801 | terminate_walk(nd); | ||
802 | return -EACCES; | 801 | return -EACCES; |
803 | } | 802 | } |
804 | 803 | ||
@@ -1980,8 +1979,10 @@ static int trailing_symlink(struct nameidata *nd) | |||
1980 | { | 1979 | { |
1981 | const char *s; | 1980 | const char *s; |
1982 | int error = may_follow_link(nd); | 1981 | int error = may_follow_link(nd); |
1983 | if (unlikely(error)) | 1982 | if (unlikely(error)) { |
1983 | terminate_walk(nd); | ||
1984 | return error; | 1984 | return error; |
1985 | } | ||
1985 | nd->flags |= LOOKUP_PARENT; | 1986 | nd->flags |= LOOKUP_PARENT; |
1986 | nd->stack[0].name = NULL; | 1987 | nd->stack[0].name = NULL; |
1987 | s = get_link(nd); | 1988 | s = get_link(nd); |