There are cases where it would be necessary to skip the setgroups(2) syscall so that the original additional groups can be maintained.
It can be used, for example, by rootless containers to keep access to a storage directory that is accessible only by a secondary group.
runc already skips the setgroups in some cases: either if the user had euid != 0 or if /proc/self/setgroups is set to deny. I'd like to add a third condition where the setgroups is skipped also if explicitly requested.
Do we need a new field under process/user, e.g. keepOriginalGroups? Would be enough to reuse additionalGids to have some special value (e.g. -1 to keep current groups)?
There are cases where it would be necessary to skip the
setgroups(2)syscall so that the original additional groups can be maintained.It can be used, for example, by rootless containers to keep access to a storage directory that is accessible only by a secondary group.
runc already skips the
setgroupsin some cases: either if the user had euid != 0 or if/proc/self/setgroupsis set todeny. I'd like to add a third condition where thesetgroupsis skipped also if explicitly requested.Do we need a new field under
process/user, e.g.keepOriginalGroups? Would be enough to reuseadditionalGidsto have some special value (e.g.-1to keep current groups)?