setreuid(p1, p2)
public
Sets the (user) real and/or effective user IDs of the current process to
rid and eid, respectively. A value of -1 for either means
to leave that ID unchanged. Not available on all platforms.
Show source
static VALUE
p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid)
{
rb_uid_t ruid, euid;
PREPARE_GETPWNAM;
check_uid_switch();
ruid = OBJ2UID1(rid);
euid = OBJ2UID1(eid);
FINISH_GETPWNAM;
if (setreuid(ruid, euid) != 0) rb_sys_fail(0);
return Qnil;
}