Skip to content

fix(sandbox): prevent overwriting symlinks - #16813

Merged
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-ryvlqwylzlps
Oct 27, 2026
Merged

Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-ryvlqwylzlps

Conversation

@Alizter

@Alizter Alizter commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@rgrinberg rgrinberg 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.

Probably worth adding some unit tests to this function.

Unix.symlink src dst)
| exception Unix.Unix_error _ -> Unix.symlink src dst)
Unix.unlink dst;
Unix.symlink src dst)

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.

Something is weird about this implementation. Why aren't we detecting overwrites with EEXIST?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That would be cleaner. I'll do it in a followup.

@Alizter

Alizter commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

I'll add the unit tests in a followup.

@Alizter
Alizter merged commit e2fa624 into ocaml:main Oct 27, 2026
37 of 39 checks passed
@Alizter
Alizter deleted the push-ryvlqwylzlps branch October 27, 2026 16:31
@Alizter Alizter added this to the 3.26.0 milestone Oct 28, 2026
Alizter added a commit that referenced this pull request Oct 28, 2026
Backport #16632, #16686, #16675, #16813, #16814 and #16806 with their
original regression tests.

All 14 upstream source patches are preserved, with original authorship
and cherry-pick references. Replaces #16832.

Build/format and regression checks pass at every commit. Full-suite
checks hit local jq-helper and bubblewrap permission failures.
Alizter added a commit that referenced this pull request Oct 28, 2026
Focused symlink invariants in per-test temporary sandboxes, with scoped
cleanup.

Follow-up to #16813.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants