AnyPS5/core/libs
milescoviello e8cb97e6e2 fix(libkernel): fail rmdir on a symbolic link instead of removing it
sceKernelRmdir, and rmdir through it, checked the path with
std::filesystem::is_directory and is_empty, which follow a symbolic
link, and then removed the path itself. So rmdir on a link to an empty
directory returned 0 and deleted the link, while the target stayed.

FreeBSD looks up the last component of rmdir's path without following
it (sys/kern/vfs_syscalls.c, kern_rmdirat: NDINIT_ATRIGHTS with
LOCKPARENT | LOCKLEAF and no FOLLOW) and then fails with ENOTDIR for
anything that is not a directory: "if (vp->v_type != VDIR) { error =
ENOTDIR; goto out; }". A link, whether it points to a directory or
nowhere, is a VLNK there.

rmdir now returns ENOTDIR for a symbolic link and leaves it alone, as
unlink already looks at the link itself through symlink_status. A
trailing slash still resolves through the link, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:30:23 +00:00
..
nid feat(nid): patch NIDs in Mach-O libraries 2026-10-09 15:40:29 +03:00
prx fix(libkernel): fail rmdir on a symbolic link instead of removing it 2026-10-11 21:30:23 +00:00
tests fix(libkernel): fail rmdir on a symbolic link instead of removing it 2026-10-11 21:30:23 +00:00
CMakeLists.txt feat(libSceRudp): implement context query calls 2026-10-11 11:07:33 +00:00
HitLog.hpp
…
SceShaders.hpp
…
SceTypes.hpp fix(libs): share Sony CRT semantics between libc and libSceAmpr with tests 2026-10-11 11:42:31 +02:00