AnyPS5/core/libs/prx/libkernel
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
..
Aio/src fix(libkernel): preserve EINVAL in AIO completions 2026-10-10 08:42:19 +02:00
AppMetadata fix(kernel): skip the download0 mount when param.json cannot be read 2026-10-08 16:07:18 +02:00
Apr fix(filesystem): reject invalid parent traversal on Windows 2026-10-12 01:25:02 +05:30
DirectMemory fix(libkernel): keep stack protection inside the stack and never throw while restoring it 2026-10-11 02:28:03 -05:00
Equeue fix(libkernel): report a level-triggered equeue event once per wait 2026-10-11 11:28:34 +00:00
EventFlag/src feat(runtime): timed waits, sync primitive fixes, heap and RTC fixes, unattended-run switches 2026-09-26 19:00:39 -07:00
File fix(libkernel): fail rmdir on a symbolic link instead of removing it 2026-10-11 21:30:23 +00:00
Module perf(libkernel): read a loaded image's unwind tables once in sceKernelGetModuleInfoFromAddr 2026-10-11 19:07:37 +02:00
Pthread Merge pull request #3484 from AchrafReyani/feat/libkernel-pthread-mutexattr-gettype 2026-10-11 13:53:23 +02:00
Semaphore fix(libkernel): accept a zero count in sceKernelSignalSema 2026-10-10 16:12:43 +00:00
Socket Merge pull request #3462 from exefer/fix/libkernel-select-host-descriptors 2026-10-11 23:24:27 +02:00
SyncOnAddress/src fix(libkernel): throw on a size-0 _umtx_op timeout that is not a valid timespec 2026-10-11 11:13:33 +02:00
System feat(libkernel): implement sigsetjmp 2026-10-11 11:23:10 +00:00
Time fix(libkernel): let exception delivery interrupt timed mutex and rwlock waits on Windows 2026-10-11 11:20:40 +02:00
CMakeLists.txt Merge pull request #3462 from exefer/fix/libkernel-select-host-descriptors 2026-10-11 23:24:27 +02:00
KernelErrors.hpp refactor(kernel): share SCE kernel error codes through KernelErrors.hpp 2026-09-27 13:32:28 +07:00
Unimplemented.cpp feat(libkernel): implement thread cancellation 2026-10-10 11:32:09 +02:00