nuttx/fs/inode
vela-autotest05 152ebca599 fs/inode: fix relative-path truncation causing wrong EISDIR
Root cause: _inode_search() built the absolute form of a relative
path with snprintf(buf, PATH_MAX, "%s/%s", cwd, path), silently
truncating it when cwd + "/" + path exceeded PATH_MAX. The truncated
buffer was then handed to _inode_canonicalize(), which collapsed
".." segments against the wrong cut-off suffix. A valid relative
path of PATH_MAX-1 bytes (legal per pathconf(_PC_PATH_MAX)) could
thus collapse onto a directory and open() returned EISDIR instead
of resolving the file.

Fix: size the temp buffer to hold the full uncanonicalized
"<cwd>/<path>" form so canonicalization sees the complete path.
lib_get_tempbuffer falls back to a malloc'd buffer when the size
exceeds PATH_MAX (CONFIG_LIBC_TEMPBUFFER_MALLOC). The existing
PATH_MAX check in _inode_canonicalize() still rejects any
canonicalized result that is too long, so ENAMETOOLONG semantics
are preserved.

Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2026-08-28 23:07:24 +08:00
..
CMakeLists.txt fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_files.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_foreachinode.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_inode.c sched: add supplementary group IDs (setgroups/getgroups/initgroups) 2026-08-12 16:06:03 -03:00
fs_inodeaddref.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_inodebasename.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_inodefind.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_inodefree.c fs: rename PSEUDOFS_SOFTLINKS to FS_LINKS 2026-08-27 01:12:33 +08:00
fs_inodegetpath.c fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00
fs_inoderelease.c nuttx/atomic: replace atomic_fetch_xxx with atomic_xxx just like zephyr 2026-08-24 13:20:45 +08:00
fs_inoderemove.c fs: rename PSEUDOFS_SOFTLINKS to FS_LINKS 2026-08-27 01:12:33 +08:00
fs_inodereserve.c fs: enforce path search and unify inode permission helpers 2026-08-02 18:48:40 -03:00
fs_inodesearch.c fs/inode: fix relative-path truncation causing wrong EISDIR 2026-08-28 23:07:24 +08:00
inode.h fs/inode: change fs_heap to lib_get_tempbuffer/lib_put_tempbuffer 2026-08-28 12:09:46 +08:00
Make.defs fs: migrate to SPDX identifier 2024-11-06 01:58:54 +08:00