Add permissions to the filesystem, preliminary permissions to the syscalls
This commit is contained in:
parent
478bc20b85
commit
f4a1d06f07
19 changed files with 142 additions and 20 deletions
6
programs/id/Cargo.toml
Normal file
6
programs/id/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "id"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
syscall = { path = "../../syscall/" }
|
11
programs/id/src/main.rs
Normal file
11
programs/id/src/main.rs
Normal 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, "");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue