Skip to content

vfs: reject rename into descendant directory#64285

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:vfs-memory-provider-rename
Jul 6, 2026
Merged

vfs: reject rename into descendant directory#64285
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:vfs-memory-provider-rename

Conversation

@trivikr

@trivikr trivikr commented Jul 4, 2026

Copy link
Copy Markdown
Member

Fixes: #64284

Fixes MemoryProvider.renameSync() so renaming a directory into its own
descendant throws EINVAL instead of detaching the subtree.


Assisted-by: openai:gpt-5.5

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
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem. labels Jul 4, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 4, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr requested a review from mcollina July 4, 2026 20:17

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 5, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 6, 2026
@nodejs-github-bot nodejs-github-bot merged commit 7d941ec into nodejs:main Jul 6, 2026
79 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 7d941ec

richardlau pushed a commit that referenced this pull request Jul 6, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. vfs Issues and PRs related to the virtual filesystem subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vfs: MemoryProvider allows renaming a directory into its own descendant

4 participants