class method
Process.initgroups
(::String username, ::Integer gid) -> ::Array[::Integer]
Process.initgroups(username, gid) → array
process.c
View on GitHub ↗
static VALUE
proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
{
if (initgroups(StringValueCStr(uname), OBJ2GID(base_grp)) != 0) {
rb_sys_fail(0);
}
return proc_getgroups(obj);
}
Sets the supplemental group access list; the new list includes:
-
The group IDs of those groups to which the user given by
usernamebelongs. -
The group ID
gid.
Example:
Example
Process.groups # => [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27] Process.initgroups('me', 30) # => [30, 6, 10, 11] Process.groups # => [30, 6, 10, 11]
Not available on all platforms.