run-userchroot: Support changing user and group via sudo
Before raising this MR, consider whether the following are required, and complete if so:
-
Unit tests -
Metrics -
Documentation update(s)
If not required, please explain in brief why not.
Description
Support specifying a user and/or a group for buildbox-run-userchroot
.
This adds the flexibility when buildbox-worker
and userchroot
need to run as different users with different permissions.
Refactoring
- Move
Credentials
struct fromcasd
tocommon
and rename it toProcessCredentials
for clarity
Follow up work in future MR(s)
- Update
CASClient
to include the overriddenuid
andgid
when requestingLocalCAS
to stage directory
Edited by Zehao Chen