Skip to content

Commit

Permalink
some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
radumarias committed Apr 23, 2024
1 parent 32b230d commit 1071cf1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use fuse3::raw::prelude::*;
use rpassword::read_password;
use strum::IntoEnumIterator;
use tokio::{fs, task};
use tracing::{error, info, Level};
use tracing::{error, info, instrument, Level};

use encryptedfs::encryptedfs::{Cipher, EncryptedFs, FsError};
use encryptedfs::encryptedfs_fuse3::EncryptedFsFuse3;
Expand Down Expand Up @@ -261,6 +261,7 @@ async fn run_normal(matches: ArgMatches, data_dir: &String, cipher: Cipher, deri
matches.get_flag("direct-io"), matches.get_flag("suid")).await;
}

#[instrument]
async fn run_fuse(mountpoint: String, data_dir: &str, password: &str, cipher: Cipher, derive_key_hash_rounds: u32,
allow_root: bool, allow_other: bool, direct_io: bool, suid_support: bool) {
let uid = unsafe { libc::getuid() };
Expand All @@ -275,6 +276,7 @@ async fn run_fuse(mountpoint: String, data_dir: &str, password: &str, cipher: Ci
.clone();
let mount_path = OsStr::new(mountpoint.as_str());

info!("Mounting FUSE filesystem");
match EncryptedFsFuse3::new(&data_dir, &password, cipher, derive_key_hash_rounds, direct_io, suid_support) {
Err(FsError::InvalidPassword) => {
println!("Cannot decrypt data, maybe the password is wrong");
Expand Down

0 comments on commit 1071cf1

Please sign in to comment.