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

Commit

Permalink
fixed #1889, .DS_Store is no longer treated as key file
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Aug 9, 2016
1 parent 73c19fd commit 51d6b9e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 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] = &[".DS_Store"];

#[cfg(not(windows))]
fn restrict_permissions_to_owner(file_path: &Path) -> Result<(), i32> {
use std::ffi;
Expand Down Expand Up @@ -62,7 +64,9 @@ 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();
metadata.is_ok() && !metadata.unwrap().is_dir() &&
!IGNORED_FILES.contains(&file_name.to_str().unwrap())
})
.map(|entry| entry.path())
.collect::<Vec<PathBuf>>();
Expand Down

0 comments on commit 51d6b9e

Please sign in to comment.