AnyPS5/core
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
..
Decoder fix(png): bound transparency chunk detection to the input 2026-10-10 09:28:30 +08:00
libs fix(libkernel): fail rmdir on a symbolic link instead of removing it 2026-10-11 21:30:23 +00:00
relinker fix(relinker): normalize additional module directory paths 2026-10-11 19:12:52 +02:00
shader/recompiler Merge pull request #2471 from Scramblrrrr/codex/shared-loop-exit 2026-10-11 23:24:02 +02:00