9
0
Fork 0

fs: fix rmdir with symlink

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2012-09-04 21:42:19 +08:00
parent 2f17f1a22f
commit f4d850eb76
1 changed files with 6 additions and 0 deletions

View File

@ -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;