Skip to content

feat: implement --copy-as USER:GROUP privilege switching - #2391

Merged
oferchen merged 1 commit into
masterfrom
feature/copy-as-privilege-switch
Feb 21, 2026
Merged

oferchen merged 1 commit into
masterfrom
feature/copy-as-privilege-switch

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Wire --copy-as USER:GROUP privilege switching through engine and metadata
  • Add copy_as.rs module in metadata crate with RAII CopyAsGuard
  • Resolve USER:GROUP to uid/gid via getpwnam/getgrnam (Unix)
  • Switch effective uid/gid via seteuid/setegid before file I/O
  • No-op stub on non-Unix platforms
  • Add copy_as_uid/copy_as_gid to LocalCopyOptions
  • Wire through core run and engine executor

Test plan

  • All tests pass
  • cargo clippy clean
  • cargo fmt clean
  • CI passes on all platforms

Wire copy-as privilege switching through engine and metadata:
- Add copy_as.rs module in metadata crate with RAII CopyAsGuard
- Resolve USER:GROUP to uid/gid via getpwnam/getgrnam (Unix)
- Switch effective uid/gid via seteuid/setegid before file I/O
- No-op stub on non-Unix platforms
- Add copy_as_uid/copy_as_gid to LocalCopyOptions
- Wire through core run and engine executor
@github-actions github-actions Bot added the enhancement New feature or request label Feb 21, 2026
@oferchen
oferchen merged commit 1f62a6b into master Feb 21, 2026
21 of 31 checks passed
@oferchen
oferchen deleted the feature/copy-as-privilege-switch branch February 21, 2026 20:15
oferchen added a commit that referenced this pull request May 1, 2026
Wire copy-as privilege switching through engine and metadata:
- Add copy_as.rs module in metadata crate with RAII CopyAsGuard
- Resolve USER:GROUP to uid/gid via getpwnam/getgrnam (Unix)
- Switch effective uid/gid via seteuid/setegid before file I/O
- No-op stub on non-Unix platforms
- Add copy_as_uid/copy_as_gid to LocalCopyOptions
- Wire through core run and engine executor
oferchen added a commit that referenced this pull request May 5, 2026
Wire copy-as privilege switching through engine and metadata:
- Add copy_as.rs module in metadata crate with RAII CopyAsGuard
- Resolve USER:GROUP to uid/gid via getpwnam/getgrnam (Unix)
- Switch effective uid/gid via seteuid/setegid before file I/O
- No-op stub on non-Unix platforms
- Add copy_as_uid/copy_as_gid to LocalCopyOptions
- Wire through core run and engine executor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant