diff --git a/rustcryptfs-linux/Cargo.toml b/rustcryptfs-linux/Cargo.toml index f528d7d..45ed3c3 100644 --- a/rustcryptfs-linux/Cargo.toml +++ b/rustcryptfs-linux/Cargo.toml @@ -6,3 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +fuser = "0.11" +log = "0.4" +rustcryptfs-lib = { path = "../rustcryptfs-lib" } +thiserror = "1.0" \ No newline at end of file diff --git a/rustcryptfs-linux/src/encrypted_filesystem.rs b/rustcryptfs-linux/src/encrypted_filesystem.rs new file mode 100644 index 0000000..29941b4 --- /dev/null +++ b/rustcryptfs-linux/src/encrypted_filesystem.rs @@ -0,0 +1,28 @@ +use std::path::Path; + +use fuser::Filesystem; +use rustcryptfs_lib::config::CryptConf; + +pub struct EncryptedFs {} + +impl EncryptedFs { + pub fn new

(path: P) -> Self + where + P: AsRef, + { + todo!() + } + + pub fn new_from_config(config: &CryptConf) -> Self { + Self {} + } + + pub fn mount

(self, mountpoint: P) + where + P: AsRef, + { + fuser::mount2(self, mountpoint, &[]).unwrap(); + } +} + +impl Filesystem for EncryptedFs {} diff --git a/rustcryptfs-linux/src/lib.rs b/rustcryptfs-linux/src/lib.rs index e69de29..304a802 100644 --- a/rustcryptfs-linux/src/lib.rs +++ b/rustcryptfs-linux/src/lib.rs @@ -0,0 +1,3 @@ +mod encrypted_filesystem; + +pub use encrypted_filesystem::EncryptedFs; \ No newline at end of file