From 63448c92a43a314d3cc7092c358888cff6270f06 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 23 Feb 2009 22:48:16 +0000 Subject: [PATCH] Better do the check for "." and ".." after stripping off superflous leafs as otherwise a "rmdir ./" would still have caused the corruption. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29299 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 88c27a6f94..06b06405bc 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -5644,7 +5644,9 @@ dir_remove(int fd, char *path, bool kernel) // "name/" -> "name", or "name/." -> "name" lastSlash[0] = '\0'; } - } else if (!strcmp(path, ".") || !strcmp(path, "..")) + } + + if (!strcmp(path, ".") || !strcmp(path, "..")) return B_NOT_ALLOWED; }