backend: Only return top-level files for most dirs

Fixes #1478
This commit is contained in:
Alexander Neumann
2017-12-14 19:13:01 +01:00
parent 42a8c19aae
commit 7d8765a937
12 changed files with 49 additions and 15 deletions

View File

@@ -122,6 +122,12 @@ func SearchKey(ctx context.Context, s *Repository, password string, maxKeys int)
return nil, ErrMaxKeysReached
}
_, err := restic.ParseID(name)
if err != nil {
debug.Log("rejecting key with invalid name: %v", name)
continue
}
debug.Log("trying key %q", name)
key, err := OpenKey(ctx, s, name, password)
if err != nil {