Skip to content

Commit

Permalink
fix: build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lind committed Nov 23, 2024
1 parent 14fd07b commit 5867d04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/safeposix/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/safeposix/vmmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions src/tests/sys_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down

0 comments on commit 5867d04

Please sign in to comment.