Change error message and info for user

This commit is contained in:
oupson 2022-10-09 12:43:26 +02:00
parent 198a75d0ee
commit 0aa87c1f53
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
2 changed files with 6 additions and 6 deletions

View File

@ -47,7 +47,7 @@ impl EncryptedFs {
log::info!("Opening dir ..."); log::info!("Opening dir ...");
let fs = GocryptFs::open(path, password)?; let fs = GocryptFs::open(path, password)?;
log::info!("Done"); println!("Filesystem mounted and ready.");
let mut inode_cache = BTreeMap::new(); let mut inode_cache = BTreeMap::new();
inode_cache.insert(FUSE_ROOT_ID, path.to_path_buf()); inode_cache.insert(FUSE_ROOT_ID, path.to_path_buf());
@ -307,7 +307,7 @@ impl Filesystem for EncryptedFs {
match self.lookup_impl(parent, name) { match self.lookup_impl(parent, name) {
Ok((ttl, attr, generation)) => reply.entry(&ttl, &attr, generation), Ok((ttl, attr, generation)) => reply.entry(&ttl, &attr, generation),
Err(e) => { Err(e) => {
log::error!("lookup : {}", e); log::debug!("error on lookup : {}", e);
reply.error(e.to_raw_code()) reply.error(e.to_raw_code())
} }
} }
@ -324,7 +324,7 @@ impl Filesystem for EncryptedFs {
match self.read_dir_impl(ino, offset, &mut reply) { match self.read_dir_impl(ino, offset, &mut reply) {
Ok(()) => reply.ok(), Ok(()) => reply.ok(),
Err(e) => { Err(e) => {
log::error!("readdir : {}", e); log::debug!("error on readdir : {}", e);
reply.error(e.to_raw_code()) reply.error(e.to_raw_code())
} }
} }

View File

@ -51,7 +51,7 @@ fn ls(c: &LsCommand) -> anyhow::Result<()> {
for dir in std::fs::read_dir(folder_path)?.flat_map(|e| e.ok()) { for dir in std::fs::read_dir(folder_path)?.flat_map(|e| e.ok()) {
let filename = dir.file_name(); let filename = dir.file_name();
let filename = filename.to_str().unwrap(); let filename = filename.to_string_lossy();
if filename != "gocryptfs.conf" && filename != "gocryptfs.diriv" { if filename != "gocryptfs.conf" && filename != "gocryptfs.diriv" {
if filename.starts_with("gocryptfs.longname.") { if filename.starts_with("gocryptfs.longname.") {
@ -62,7 +62,7 @@ fn ls(c: &LsCommand) -> anyhow::Result<()> {
println!("{}", res); println!("{}", res);
} }
} }
} else if let Ok(res) = dir_decoder.decode_filename(filename) { } else if let Ok(res) = dir_decoder.decode_filename(&*filename) {
println!("{}", res); println!("{}", res);
} }
} }
@ -88,7 +88,7 @@ fn decrypt_file(c: &DecryptCommand) -> anyhow::Result<()> {
&password, &password,
)?; )?;
let mut file = File::open(file_path).unwrap(); let mut file = File::open(file_path)?;
let enc = fs.content_decoder(); let enc = fs.content_decoder();