File owner fix#2
Merged
Merged
Conversation
Coverage Report for CI Build 25878532318Coverage increased (+0.4%) to 36.413%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
Refactors file-ownership/chown logic out of install_server.go into a new internal/app/osowner package and threads owner options (User / UID / GID coming from the proto) through the gRPC file write, transfer, and mkdir handlers so files/directories created by the daemon on behalf of API requests can be assigned to the correct unprivileged user. Also bumps the gameap proto module and a few transitive golang.org/x/* deps.
Changes:
- New
osownerpackage withOptions,Resolve,ApplyToPath,ApplyRecursive,MissingSegments, plus unix/windows split forisRootUser,lchown,chownTree. grpc/file_handler.go(HandleFileWrite,handleMkdirOp) andgrpc/transfer_handler.go(HandleFileUploadTask) now compute newly-created path segments, apply owner to them, and honor a per-requestMode.install_server.gochownrewritten to delegate toosowner.ApplyRecursive; duplicatedchownR/build-tagged helpers removed fromgame_server_commands/os_utils_*.go. Bumpsgameapproto andgo-jose,crypto,net,sys,text,genproto/rpcdeps ingo.mod/go.sum.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/app/osowner/owner.go |
New package: Options/Resolve/ApplyToPath/ApplyRecursive/MissingSegments. |
internal/app/osowner/owner_unix.go |
Linux/Darwin implementations of isRootUser, lchown, chownTree (uses os.OpenRoot). |
internal/app/osowner/owner_windows.go |
Windows no-op lchown/chownTree; isRootUser checks System/Administrator. |
internal/app/osowner/owner_test.go |
Unit tests for IsZero, Resolve short-circuit, Apply* no-ops, and MissingSegments. |
internal/app/grpc/file_handler.go |
HandleFileWrite and handleMkdirOp thread osowner.Options and chown only newly-created path segments. |
internal/app/grpc/transfer_handler.go |
Upload task chowns new parent dirs + temp file before atomic rename; honors task.Mode. |
internal/app/grpc/file_owner_test.go |
New tests for owner-propagation paths in file write and mkdir handlers. |
internal/app/game_server_commands/install_server.go |
chown now delegates to osowner.ApplyRecursive (also implicitly fixes the prior Atoi(systemUser.Uid) bug used for the gid). |
internal/app/game_server_commands/os_utils_unix.go |
Removes now-duplicated chownR and io/fs import. |
internal/app/game_server_commands/os_utils_windows.go |
Removes the now-duplicated chownR no-op. |
go.mod / go.sum |
Bumps gameap proto to the version that adds OwnerUser/OwnerUid/OwnerGid/Mode; transitive bumps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.