fix(libkernel): remove a Windows directory junction without emptying its target #7530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7530"
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 mazen320 on 2026-10-18T12:28:38Z.
What
rmdirof a Windows directory junction followed the target. When the target held a file,rmdirandsceKernelRmdirreturnedENOTEMPTYand left the junction.unlinkandsceKernelUnlinktreated the junction as a directory and returnedEPERM.A drive-absolute directory junction now gets
ENOTDIRfromrmdirwithout inspecting the target.unlinkremoves only the junction and leaves the target, including when the target is not empty. A volume mount whose substitute name is a Volume GUID, and any other reparse point, stay on the previous path.Tested
Windows 11, WinLibs GCC 15.2.0, unelevated.
guest_filesystem(ctest #1200) passed, including a junction whose target contains a file. Conventions passed againstupstream/main. GitHub Windows and Linux CI were not run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by TheTerr4 on 2026-10-18T14:59:36Z.
Windows runtime check. Windows 11 Pro 10.0.26200, Ryzen 7 7800X3D, WinLibs GCC 15.2.0 r7 (UCRT), Release.
This PR's head
b40234c7dmerged cleanly intomain385ed71f2; the full build andlibsboth exit 0.guest_filesystem,guest_posix_filesystemandguest_kernel_syspass, three repeated-j1runs.libkernel/File/src/Open.cppandStdio.cpprestored tomain's versions,guest_filesystemaborts (exit 0xc0000409).guest_filesystemare skipped on this machine (Developer Mode is off); the junction cases ran.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-21T06:51:38Z.
Rebased onto current
main. KeptPathLookupFailureafter the symlink check and merged the junctionrmdir/unlinkdebt note with the existingO_NOFOLLOWsentence.Local tip
de097ab0c:guest_filesystempassed.Pull request closed