-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
mod file_handle; | ||
mod inode; | ||
#[cfg(test)] | ||
mod test; | ||
|
||
use std::ffi::OsStr; | ||
use std::fs; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use std::path::PathBuf; | ||
|
||
use remotefs::fs::UnixPex; | ||
use remotefs::RemoteFs; | ||
use remotefs_memory::{node, Inode, MemoryFs, Node, Tree}; | ||
|
||
use crate::Driver; | ||
|
||
fn setup_driver() -> Driver { | ||
let gid = nix::unistd::getgid().as_raw(); | ||
let uid = nix::unistd::getuid().as_raw(); | ||
|
||
let tree = Tree::new(node!( | ||
PathBuf::from("/"), | ||
Inode::dir(uid, gid, UnixPex::from(0o755)), | ||
)); | ||
|
||
let fs = MemoryFs::new(tree) | ||
.with_get_gid(|| nix::unistd::getgid().as_raw()) | ||
.with_get_uid(|| nix::unistd::getuid().as_raw()); | ||
|
||
let fs = Box::new(fs) as Box<dyn RemoteFs>; | ||
|
||
Driver::from(fs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
use remotefs_fuse::Driver; | ||
|
||
use std::path::PathBuf; | ||
|
||
use remotefs::fs::UnixPex; | ||
use remotefs::RemoteFs; | ||
use remotefs_memory::{node, Inode, MemoryFs, Node, Tree}; | ||
|
||
pub fn setup_driver() -> Driver { | ||
todo!(); | ||
let tree = Tree::new(node!( | ||
PathBuf::from("/"), | ||
Inode::dir(0, 0, UnixPex::from(0o755)), | ||
)); | ||
|
||
let fs = MemoryFs::new(tree); | ||
|
||
let fs = Box::new(fs) as Box<dyn RemoteFs>; | ||
|
||
Driver::from(fs) | ||
} |