uid=(p1)
public
Sets the (integer) user ID for this process. Not available on all
platforms.
Show source
static VALUE
proc_setuid(VALUE obj, VALUE id)
{
rb_uid_t uid;
check_uid_switch();
uid = NUM2UIDT(id);
if (setresuid(uid, -1, -1) < 0) rb_sys_fail(0);
if (setreuid(uid, -1) < 0) rb_sys_fail(0);
if (setruid(uid) < 0) rb_sys_fail(0);
{
if (geteuid() == uid) {
if (setuid(uid) < 0) rb_sys_fail(0);
}
else {
rb_notimplement();
}
}
rb_notimplement();
return id;
}