]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
vfs: add ENAMETOOLONG checks to path helpers in fs.c
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 02:12:56 +0000 (23:12 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 02:12:56 +0000 (23:12 -0300)
commitdd0297e956d1296469878098cef0a6af4ac02de1
tree0a34e2117495bcd2757586a27fc22246b8e033b8
parent50f38c3ecf964223aaa901499e97e5f0a347c932
vfs: add ENAMETOOLONG checks to path helpers in fs.c

Implement L1: standardize ENAMETOOLONG across all path helpers.

Added path length checks (PATH_MAX = 128) to:
- vfs_lookup_depth(): Check path length before lookup
- vfs_lookup_parent(): Check path length before parent lookup
- vfs_mkdirp(): Check path length before recursive mkdir

These functions now return NULL or -ENAMETOOLONG when paths exceed
128 characters, matching the behavior already present in syscall.c
helpers (copy_user_cstr, path_resolve_user).

Test: make test-battery PASS (157/157), make analyzer PASS
src/kernel/fs.c