Module: Process::GID
Relationships & Source Files | |
Defined in: | process.c |
Overview
The GID
module contains a collection of module functions which can be used to portably get, set, and switch the current process's real, effective, and saved group IDs.
Class Attribute Summary
-
.re_exchangeable? ⇒ Boolean
readonly
mod_func
Returns
true
if the real and effective group IDs of a process may be exchanged on the current platform. -
.rid ⇒ Fixnum
readonly
mod_func
Alias for gid.
-
.sid_available? ⇒ Boolean
readonly
mod_func
Returns
true
if the current platform has saved group ID functionality.
Class Method Summary
-
.change_privilege(group) ⇒ Fixnum
mod_func
Change the current process's real and effective group ID to that specified by group.
-
.eid ⇒ Fixnum
mod_func
Alias for egid.
-
.from_name(name) ⇒ GID
mod_func
Get the group ID by the name.
-
.grant_privilege(group) ⇒ Fixnum
mod_func
Set the effective group ID, and if possible, the saved group ID of the process to the given group.
-
.re_exchange ⇒ Fixnum
mod_func
Exchange real and effective group IDs and return the new effective group ID.
-
.switch ⇒ Fixnum
mod_func
Switch the effective and real group IDs of the current process.
Class Attribute Details
.re_exchangeable? ⇒ Boolean
(readonly, mod_func)
Returns true
if the real and effective group IDs of a process may be exchanged on the current platform.
.rid ⇒ Fixnum (readonly, mod_func)
Alias for Process.gid.
.sid_available? ⇒ Boolean
(readonly, mod_func)
Returns true
if the current platform has saved group ID functionality.
Class Method Details
.change_privilege(group) ⇒ Fixnum (mod_func)
.eid ⇒ Fixnum (mod_func)
Alias for Process.egid.
.from_name(name) ⇒ GID
(mod_func)
Get the group ID by the name. If the group is not found, ::ArgumentError will be raised.
Process::GID.from_name("wheel") #=> 0
Process::GID.from_name("nosuchgroup") #=> can't find group for nosuchgroup (ArgumentError)
.re_exchange ⇒ Fixnum (mod_func)
Switch the effective and real group IDs of the current process. If a block is given, the group IDs will be switched back after the block is executed. Returns the new effective group ID if called without a block, and the return value of the block if one is given.