* Fixed bug in the code normalizing entry paths, causing e.g. broken

symlinks to be not openable.
* When _kern_open() created a new file, invalid stat data were accessed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22176 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-09-05 02:58:01 +00:00
parent 4c8f3064a2
commit 598d021972
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ normalize_entry_path(const char *path, string &normalizedPath)
}
// catch special case: no leaf, or leaf is a directory
if (!leafName || strcmp(leafName, ".") == 0 || strcmp(leafName, ".."))
if (!leafName || strcmp(leafName, ".") == 0 || strcmp(leafName, "..") == 0)
return normalize_dir_path(path, normalizedPath);
// normalize the dir path
@ -514,7 +514,7 @@ open_file(const char *path, int openMode, int perms)
}
// cache path, if this is a directory
if (S_ISDIR(st.st_mode))
if (exists && S_ISDIR(st.st_mode))
add_dir_path(path, NodeRef(st));
return add_descriptor(descriptor);