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