summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 6a855130a1..914df5acbb 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1253,6 +1253,12 @@ int rmdir (const char *pathname)
char *freep = p;
int ret;
+ ret = path_check_prereq(pathname, S_IFLNK);
+ if (!ret) {
+ ret = -ENOTDIR;
+ goto out;
+ }
+
ret = path_check_prereq(pathname, S_IFDIR | S_UB_IS_EMPTY);
if (ret)
goto out;