Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

fixed #1889, .DS_Store is no longer treated as key file #1892

Merged
merged 5 commits into from
Aug 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ethstore/src/dir/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use ethkey::Address;
use {json, SafeAccount, Error};
use super::KeyDirectory;

const IGNORED_FILES: &'static [&'static str] = &["thumbs.db"];

#[cfg(not(windows))]
fn restrict_permissions_to_owner(file_path: &Path) -> Result<(), i32> {
use std::ffi;
Expand Down Expand Up @@ -62,7 +64,14 @@ impl DiskDirectory {
.flat_map(Result::ok)
.filter(|entry| {
let metadata = entry.metadata();
metadata.is_ok() && !metadata.unwrap().is_dir()
let file_name = entry.file_name();
let name = file_name.to_str().unwrap();
// filter directories
metadata.is_ok() && !metadata.unwrap().is_dir() &&
// hidden files
!name.starts_with(".") &&
// other ignored files
!IGNORED_FILES.contains(&name)
})
.map(|entry| entry.path())
.collect::<Vec<PathBuf>>();
Expand Down