Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Process::UID.grant_privilege

(::Integer user) -> ::Integer
Process::UID.grant_privilege(user) → integer
Process::UID.eid= user → integer

Set the effective user ID, and if possible, the saved user ID of the process to the given user. Returns the new effective user ID. Not available on all platforms.

Example
[Process.uid, Process.euid]          #=> [0, 0]
Process::UID.grant_privilege(31)     #=> 31
[Process.uid, Process.euid]          #=> [0, 31]
See also .from_name .re_exchange .eid .re_exchangeable? also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0