Skip to content

Conversation

nayuta-ai
Copy link
Contributor

Description

Add a system call mock for uid, gid. euid, egid, etc.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)

Related Issues

Fixes #3136

Additional Context

This change is related to the issue discussed in this comment.
I have moved the get operations for uid, gid, euid, and egid used in the libcontainer and youki crates into the syscall package. As for libcgroup and runtimetest, they are not dependent on libcontainer, so they are omitted.

Signed-off-by: nayuta-ai <[email protected]>
@nayuta-ai nayuta-ai mentioned this pull request May 25, 2025
13 tasks
@utam0k utam0k added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 27, 2025
gid: Gid,
euid: Uid,
egid: Gid,
// TODO: add more fields such as suid, sgid, etc.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we will need to add these IDs. Why did you think we needed them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The set_id function sets uid/euid/suid and gid/egid/sgid, so I initially thought we might need these fields in the future. However, since there’s currently no implementation for get_suid or get_sgid on nix, they aren't necessary at this point. I'll remove them, thanks!

Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

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

Thanks!

@utam0k
Copy link
Member

utam0k commented May 28, 2025

!github easy-benchmark

@utam0k utam0k merged commit 61c9ae0 into youki-dev:main May 28, 2025
29 checks passed
@github-actions github-actions bot mentioned this pull request May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Define Linux Network Devices
2 participants