Use setreuid, setregid for more control over process state
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "redox_syscall"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
description = "A Rust library to access raw Redox system calls"
|
||||
license = "MIT"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
|
||||
12
src/call.rs
12
src/call.rs
@@ -216,14 +216,14 @@ pub fn rmdir(path: &str) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_RMDIR, path.as_ptr() as usize, path.len()) }
|
||||
}
|
||||
|
||||
/// Set the current process group ID
|
||||
pub fn setgid(gid: usize) -> Result<usize> {
|
||||
unsafe { syscall1(SYS_SETGID, gid) }
|
||||
/// Set the current process group IDs
|
||||
pub fn setregid(rgid: usize, egid: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_SETREGID, rgid, egid) }
|
||||
}
|
||||
|
||||
/// Set the current process user ID
|
||||
pub fn setuid(uid: usize) -> Result<usize> {
|
||||
unsafe { syscall1(SYS_SETUID, uid) }
|
||||
/// Set the current process user IDs
|
||||
pub fn setreuid(ruid: usize, euid: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_SETREUID, ruid, euid) }
|
||||
}
|
||||
|
||||
/// Create and set a new scheme namespace
|
||||
|
||||
@@ -53,8 +53,8 @@ pub const SYS_PHYSMAP: usize = 947;
|
||||
pub const SYS_PHYSUNMAP: usize =948;
|
||||
pub const SYS_VIRTTOPHYS: usize=949;
|
||||
pub const SYS_PIPE2: usize = 331;
|
||||
pub const SYS_SETGID: usize = 214;
|
||||
pub const SYS_SETUID: usize = 213;
|
||||
pub const SYS_SETREGID: usize = 204;
|
||||
pub const SYS_SETREUID: usize = 203;
|
||||
pub const SYS_SETNS: usize = 310;
|
||||
pub const SYS_WAITPID: usize = 7;
|
||||
pub const SYS_YIELD: usize = 158;
|
||||
|
||||
Reference in New Issue
Block a user