Skip to content

Commit

Permalink
FsCrypt: silently skip "." and ".." when loading keys
Browse files Browse the repository at this point in the history
Avoid logging useless messages like:

    D vold    : Skipping non-key .
    D vold    : Skipping non-key ..
    D vold    : Skipping non-de-key .
    D vold    : Skipping non-de-key ..

Change-Id: I8d2bd67d554605a5ab9faadd3730870dfe0881f6
  • Loading branch information
ebiggers committed Nov 2, 2020
1 parent 7bcf427 commit 6b84039
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions FsCrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ using android::base::StartsWith;
using android::base::StringPrintf;
using android::fs_mgr::GetEntryForMountPoint;
using android::vold::BuildDataPath;
using android::vold::IsDotOrDotDot;
using android::vold::IsFilesystemSupported;
using android::vold::kEmptyAuthentication;
using android::vold::KeyBuffer;
Expand Down Expand Up @@ -140,6 +141,7 @@ static std::vector<std::string> get_ce_key_paths(const std::string& directory_pa
}
break;
}
if (IsDotOrDotDot(*entry)) continue;
if (entry->d_type != DT_DIR || entry->d_name[0] != 'c') {
LOG(DEBUG) << "Skipping non-key " << entry->d_name;
continue;
Expand Down Expand Up @@ -391,6 +393,7 @@ static bool load_all_de_keys() {
}
break;
}
if (IsDotOrDotDot(*entry)) continue;
if (entry->d_type != DT_DIR || !is_numeric(entry->d_name)) {
LOG(DEBUG) << "Skipping non-de-key " << entry->d_name;
continue;
Expand Down Expand Up @@ -973,6 +976,7 @@ static bool destroy_volume_keys(const std::string& directory_path, const std::st
}
break;
}
if (IsDotOrDotDot(*entry)) continue;
if (entry->d_type != DT_DIR || entry->d_name[0] == '.') {
LOG(DEBUG) << "Skipping non-user " << entry->d_name;
continue;
Expand Down

0 comments on commit 6b84039

Please sign in to comment.