fix: skip chown in rootless containers via ensure_ownership helper#33
Open
dotconfig404 wants to merge 1 commit intoOpenVoxProject:mainfrom
Open
fix: skip chown in rootless containers via ensure_ownership helper#33dotconfig404 wants to merge 1 commit intoOpenVoxProject:mainfrom
dotconfig404 wants to merge 1 commit intoOpenVoxProject:mainfrom
Conversation
bastelfreak
reviewed
Apr 13, 2026
| end | ||
| end | ||
| end | ||
| end No newline at end of file |
Contributor
There was a problem hiding this comment.
please add the missing newline
Contributor
|
@dotconfig404 thanks for the PR! Please see the failing the DCO check: https://github.com/OpenVoxProject/openvoxserver-ca/pull/33/checks |
921d584 to
95b4b5a
Compare
Signed-off-by: dotconfig <dotconfig@krutt.org>
95b4b5a to
016db7f
Compare
Member
slauger
approved these changes
Apr 13, 2026
3 tasks
Member
|
@bastelfreak Could you approve the GitHub Actions workflow for this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative to #30 and #32 that fixes the same rootless-container issue with a small refactor.
In rootless containers,
openvoxserver-camay run withoutCAP_CHOWN. In that case, theFileUtils.chowncalls infile_system.rbcan raiseErrno::EPERM, aborting commands such aspuppetserver ca setuporpuppetserver ca import.This PR consolidates ownership changes into a single helper:
FileSystem.ensure_ownership(path). The helper only performschownwhen running as root; otherwise it is a no-op. When running as non-root, the current process has created the path, so ownership is already correct.Note that
find_user_and_groupalready falls back to the current user when not running as root, so existing call sites effectively perform a no-opchownin that case.forcibly_symlinkbypasses this and uses the source UID/GID directly, which is what triggersEPERMin rootless environments.This PR makes the “should we chown at all?” decision explicit and consistent across all call sites.
Compared with #30 and #32, this keeps the same behavioral fix but centralizes the logic in one place, making it easier to reason about.
This preserves existing behavior when running as root.
Changes
file_system.rbfind_user_and_group/@user/@groupensure_ownership(path)ensure_ownership