libc/libkernel: rename of a path that ends in '.' or '..' renames the directory instead of failing with EINVAL #8173
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T01:18:23Z.
Repro
Windows host.
mkdir("dir"); rename("dir/.", "other")movesdirtoother; the same forrename(x, "dir/."),rename(".", x),rename(x, ".")andsceKernelRename.Expected (FreeBSD 11.4
lookup, sys/kern/vfs_lookup.c, ISLASTCN for DELETE/RENAME): EINVAL (22) for a last component of.or.., for source and destination.Actual: the guest path resolver drops the
.before the host call, so the directory itself is renamed.Test:
core/libs/tests/GuestRenameDot.cpp(fails with 0xc0000409 before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/rename-dot-component-fb
AI-assisted (Claude Code).