Skip to content

v5: Deprecate ChrootOS in favour of BoundOS#201

Merged
pjbgf merged 4 commits into
go-git:releases/v5.xfrom
pjbgf:v5-improvements
May 3, 2026
Merged

v5: Deprecate ChrootOS in favour of BoundOS#201
pjbgf merged 4 commits into
go-git:releases/v5.xfrom
pjbgf:v5-improvements

Conversation

@pjbgf

@pjbgf pjbgf commented May 3, 2026

Copy link
Copy Markdown
Member

Updates the v5 OS filesystem helpers with a few path-handling improvements:

  • Tightens ChrootOS boundary checks for additional parent-path variants.
  • Documents ChrootHelper as a soft-chroot helper, not a containment boundary.
  • Improves BoundOS handling for dot paths and base-directory operations.
  • Marks ChrootOS and WithChrootOS as deprecated in favor of BoundOS.
  • Adds README guidance that v5 is in maintenance mode and users should move to v6 where possible.

Copilot AI review requested due to automatic review settings May 3, 2026 21:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates v5 OS filesystem helpers to steer users away from ChrootOS (soft-chroot semantics) toward BoundOS, while tightening path handling around dot-paths, base-directory operations, and boundary-crossing variants. It also refreshes dependencies and documents v5’s maintenance-mode status.

Changes:

  • Deprecates ChrootOS and WithChrootOS in favor of BoundOS (WithBoundOS), and documents ChrootHelper as not being a security boundary.
  • Improves BoundOS behavior for dot paths and base-dir operations (e.g., preventing remove/rename of the base dir and handling ./ / . cases).
  • Adds/extends tests for boundary-crossing path variants and dot-path handling; updates README and module dependencies.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/chroot.go Adds tests for additional boundary-crossing path variants.
osfs/os_chroot.go Marks ChrootOS as deprecated in favor of WithBoundOS.
osfs/os_bound_test.go Adds coverage for dot paths, base-dir protection, and abs() error propagation.
osfs/os_bound.go Implements dot-path expansion, base-dir protection for remove/rename, and returns securejoin errors from abs().
osfs/os.go Updates New/option docs; deprecates WithChrootOS.
helper/chroot/chroot_test.go Adds tests for boundary-crossing variants and isCrossBoundaries behavior.
helper/chroot/chroot.go Tightens isCrossBoundaries logic and documents helper’s non-containment properties.
go.mod Bumps Go version and updates dependency versions.
go.sum Updates sums to match dependency upgrades.
README.md Notes v5 maintenance mode and encourages upgrading to v6.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread osfs/os_bound.go Outdated
Comment thread osfs/os_bound.go
Comment thread test/chroot.go
Comment thread go.mod
pjbgf added 4 commits May 3, 2026 22:25
Signed-off-by: Paulo Gomes <paulo@entire.io>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Signed-off-by: Paulo Gomes <paulo@entire.io>
@pjbgf pjbgf force-pushed the v5-improvements branch from 0a9908f to 81229e2 Compare May 3, 2026 21:26
@pjbgf pjbgf merged commit 8bf3d05 into go-git:releases/v5.x May 3, 2026
11 checks passed
@pjbgf pjbgf deleted the v5-improvements branch May 3, 2026 21:43
Maks1mS pushed a commit to stplr-dev/stplr that referenced this pull request May 10, 2026
This PR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [github.com/go-git/go-billy/v5](https://github.com/go-git/go-billy) | require | minor | `v5.8.0` → `v5.9.0` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-git/go-billy/badge)](https://securityscorecards.dev/viewer/?uri=github.com/go-git/go-billy) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information.

---

### Release Notes

<details>
<summary>go-git/go-billy (github.com/go-git/go-billy/v5)</summary>

### [`v5.9.0`](https://github.com/go-git/go-billy/releases/tag/v5.9.0)

[Compare Source](go-git/go-billy@v5.8.0...v5.9.0)

#### What's Changed

- Use path.Clean instead of filepath.Clean in iofs.Open by [@&#8203;puerco](https://github.com/puerco) in [#&#8203;197](go-git/go-billy#197)
- Deprecate ChrootOS in favour of BoundOS by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;201](go-git/go-billy#201)
- General Improvements by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;203](go-git/go-billy#203)
- osfs: ChrootOS eval baseDir on creation by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;205](go-git/go-billy#205)
- Run go-git tests as part of integration tests by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;206](go-git/go-billy#206)

**Full Changelog**: <go-git/go-billy@v5.8.0...v5.9.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday (`* 0-4,22-23 * * 1-5`)
  - Only on Sunday and Saturday (`* * * * 0,6`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzIuMyIsInVwZGF0ZWRJblZlciI6IjQzLjEzMi4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY2llcyJdfQ==-->

Reviewed-on: https://altlinux.space/stapler/stplr/pulls/426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants