| Summary: | Pseudo fails to properly ENOTDIR on stat/lstat | ||
|---|---|---|---|
| Product: | [Yocto Project Subprojects] Pseudo | Reporter: | aerial9 |
| Component: | pseudo | Assignee: | Seebs <seebs> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | sgw, yp.pseudo.watcher, yp.watcher |
| Version: | unspecified | ||
| Target Milestone: | 1.8 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
aerial9
2014-12-23 04:58:47 UTC
Huh, that's fascinating! I was not aware of this idiom. Apparently, the stat syscall will take a literal filename of "a/" as meaning the same thing as "a", but will fail with ENOTDIR if a is not a directory. I'd never seen that before, and my initial check of the documentation doesn't actually turn it up, but it's probably possible to implement. It seems to be explained in path_resolution(7), specifically:
Trailing slashes
If a pathname ends in a '/', that forces resolution of the preceding component as in Step 2: it has to exist and resolve to a directory. Oth‐
erwise, a trailing '/' is ignored. (Or, equivalently, a pathname with a trailing '/' is equivalent to the pathname obtained by appending '.'
to it.)
Oh, whoops. This got fixed a while back, I never updated the bug. |