Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This changes the behavior of paths that attempt to navigate above root to return LFS_ERR_INVAL: - before: lfs_stat("..") => 0 - after: lfs_stat("..") => LFS_ERR_INVAL This is a bit of an opinionated change while making other path resolution tweaks. --- It's a bit unclear exactly what dotdots above the root should do. POSIX notes: "As a special case, in the root directory, dot-dot may refer to the root directory itself.", but the word choice of "may" implies it is up to the implementation. Originally I implemented this as a loop-root because that's what my Linux machine does, but I think this may have been the wrong choice. Because, well, in what world should "/.." not be an error? Long-term, this should help be more consistent with openat-like APIs, where ".." should either error with LFS_ERR_INVAL or actually navigate above the relative path. "Saturating" the ".." navigation really doesn't make sense in this case.
- Loading branch information