[−][src]Function users::switch::set_both_uid
pub fn set_both_uid(ruid: uid_t, euid: uid_t) -> IOResult<()>
Sets both the current user and the effective user for the running process to the ones with the given user IDs.
Typically, trying to switch to anyone other than the user already running the process requires root privileges.
libc functions used
setreuid
Examples
use users::switch::set_both_uid; set_both_uid(1001, 1001); // current user ID and effective user ID are 1001