diff --git a/src/safeposix/dispatcher.rs b/src/safeposix/dispatcher.rs index 814a240..9e60b02 100644 --- a/src/safeposix/dispatcher.rs +++ b/src/safeposix/dispatcher.rs @@ -133,6 +133,7 @@ use crate::interface::types; use crate::interface::{SigactionStruct, StatData}; use crate::{fdtables, interface}; use crate::interface::errnos::*; +use crate::constants::{O_RDONLY, O_WRONLY}; macro_rules! get_onearg { ($arg: expr) => { @@ -1105,8 +1106,8 @@ pub fn lindrustinit(verbosity: isize) { // STDIN let dev_null = CString::new("/home/lind/lind_project/src/safeposix-rust/tmp/dev/null").unwrap(); unsafe { - libc::open(dev_null.as_ptr(), libc::O_RDONLY); - libc::open(dev_null.as_ptr(), libc::O_WRONLY); + libc::open(dev_null.as_ptr(), O_RDONLY); + libc::open(dev_null.as_ptr(), O_WRONLY); libc::dup(1); } diff --git a/src/safeposix/vmmap.rs b/src/safeposix/vmmap.rs index 32f40f9..7e2efac 100644 --- a/src/safeposix/vmmap.rs +++ b/src/safeposix/vmmap.rs @@ -71,7 +71,7 @@ impl VmmapEntry { // this is effectively whatever mode the file was opened with // we need this because we shouldnt be able to change filed backed mappings // to have protections exceeding that of the file - fn get_max_prot(&self, cage_id: u64, virtual_fd: u64 -> i32 { + fn get_max_prot(&self, cage_id: u64, virtual_fd: u64) -> i32 { let wrappedvfd = fdtables::translate_virtual_fd(cage_id, virtual_fd as u64); if wrappedvfd.is_err() { diff --git a/src/tests/sys_tests.rs b/src/tests/sys_tests.rs index f72b4f1..78419de 100644 --- a/src/tests/sys_tests.rs +++ b/src/tests/sys_tests.rs @@ -6,6 +6,7 @@ pub mod sys_tests { use super::super::*; use crate::interface; + use crate::constants::DEFAULT_UID; // use crate::safeposix::cage::{FileDescriptor::*, *}; use crate::safeposix::{cage::*, dispatcher::*, filesystem};