Add sudo command, add effective UID and GID, and groups file

This commit is contained in:
Jeremy Soller 2016-10-05 20:31:59 -06:00
parent f38426e458
commit cb5d1fbc58
14 changed files with 214 additions and 40 deletions

View file

@ -88,6 +88,14 @@ pub fn getcwd(buf: &mut [u8]) -> Result<usize> {
unsafe { syscall2(SYS_GETCWD, buf.as_mut_ptr() as usize, buf.len()) }
}
pub fn getegid() -> Result<usize> {
unsafe { syscall0(SYS_GETEGID) }
}
pub fn geteuid() -> Result<usize> {
unsafe { syscall0(SYS_GETEUID) }
}
pub fn getgid() -> Result<usize> {
unsafe { syscall0(SYS_GETGID) }
}

View file

@ -35,6 +35,8 @@ pub const SYS_EXECVE: usize = 11;
pub const SYS_EXIT: usize = 1;
pub const SYS_FUTEX: usize = 240;
pub const SYS_GETCWD: usize = 183;
pub const SYS_GETEGID: usize = 202;
pub const SYS_GETEUID: usize = 201;
pub const SYS_GETGID: usize = 200;
pub const SYS_GETPID: usize = 20;
pub const SYS_GETUID: usize = 199;