From 58228478427f055e0b8f540925e76514b54e4119 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 7 Apr 2008 19:41:49 +0000 Subject: [PATCH] If the entry leaf name is "." or ".." we need to resolve it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24860 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/build/libbe/storage/Entry.cpp | 10 ++++++++++ src/kits/storage/Entry.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/build/libbe/storage/Entry.cpp b/src/build/libbe/storage/Entry.cpp index 06e8cb4916..a5b9ba53ff 100644 --- a/src/build/libbe/storage/Entry.cpp +++ b/src/build/libbe/storage/Entry.cpp @@ -899,6 +899,16 @@ BEntry::set(int dirFD, const char *path, bool traverse) return dirFD; fdCloser.SetTo(dirFD); } + } else if (strcmp(leafName, ".") == 0 + || strcmp(leafName, "..") == 0) { + // We have to resolve this to get the entry name. Just open + // the dir and let the next iteration deal with it. + dirFD = _kern_open_dir(-1, path); + if (dirFD < 0) + return dirFD; + fdCloser.SetTo(dirFD); + path = NULL; + continue; } else { int parentFD = _kern_open_dir(dirFD, dirPath); if (parentFD < 0) diff --git a/src/kits/storage/Entry.cpp b/src/kits/storage/Entry.cpp index ddba1b0fe0..1760598538 100644 --- a/src/kits/storage/Entry.cpp +++ b/src/kits/storage/Entry.cpp @@ -901,6 +901,16 @@ BEntry::set(int dirFD, const char *path, bool traverse) return dirFD; fdCloser.SetTo(dirFD); } + } else if (strcmp(leafName, ".") == 0 + || strcmp(leafName, "..") == 0) { + // We have to resolve this to get the entry name. Just open + // the dir and let the next iteration deal with it. + dirFD = _kern_open_dir(-1, path); + if (dirFD < 0) + return dirFD; + fdCloser.SetTo(dirFD); + path = NULL; + continue; } else { int parentFD = _kern_open_dir(dirFD, dirPath); if (parentFD < 0)