Sets the (user) real, effective, and saved user IDs of the current process
to rid,eid, and sid respectively. A value of -1
for any value means to leave that ID unchanged. Not available on all
platforms.
static VALUE
p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
{
rb_uid_t ruid, euid, suid;
PREPARE_GETPWNAM;
check_uid_switch();
ruid = OBJ2UID1(rid);
euid = OBJ2UID1(eid);
suid = OBJ2UID1(sid);
FINISH_GETPWNAM;
if (setresuid(ruid, euid, suid) != 0) rb_sys_fail(0);
return Qnil;
}