Add permissions to the filesystem, preliminary permissions to the syscalls

This commit is contained in:
Jeremy Soller 2016-10-05 14:24:08 -06:00
parent 478bc20b85
commit f4a1d06f07
19 changed files with 142 additions and 20 deletions

6
programs/id/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "id"
version = "0.1.0"
[dependencies]
syscall = { path = "../../syscall/" }

11
programs/id/src/main.rs Normal file
View file

@ -0,0 +1,11 @@
#![feature(question_mark)]
extern crate syscall;
use std::env;
pub fn main() {
let uid = syscall::getuid().expect("id: failed to get UID");
let gid = syscall::getgid().expect("id: failed to get GID");
println!("uid={}({}) gid={}({})", uid, env::var("USER").unwrap_or(String::new()), gid, "");
}