vfs: reject rename into descendant directory · nodejs/node@d5f01bb · GitHub
Skip to content

Commit d5f01bb

Browse files
trivikrrichardlau
authored andcommitted
vfs: reject rename into descendant directory
MemoryProvider allowed renaming a directory into its own descendant, which detached the subtree from the root. Reject this case with EINVAL before mutating the tree. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #64285 Fixes: #64284 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 7f7e586 commit d5f01bb

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

lib/internal/vfs/providers/memory.js

Lines changed: 6 additions & 0 deletions

test/parallel/test-vfs-rename.js

Lines changed: 14 additions & 0 deletions

0 commit comments

Comments
 (0)