Use setreuid, setregid for more control over process state

This commit is contained in:
Jeremy Soller
2016-11-17 14:09:40 -07:00
parent 7b8cc59890
commit 8ce29a6ea2
3 changed files with 9 additions and 9 deletions

View File

@@ -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>"]

View File

@@ -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

View File

@@ -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;