Also filter out some other obviously invalid filenames (ref #1243)

This commit is contained in:
Jakob Borg
2015-01-13 12:28:35 +01:00
parent 25c26e2f81
commit 9a45f0b31c
2 changed files with 10 additions and 6 deletions

View File

@@ -587,8 +587,9 @@ func ldbWithAllFolderTruncated(db *leveldb.DB, folder []byte, fn func(device []b
panic(err)
}
if f.Name == "" {
l.Infoln("Dropping invalid nil filename from database")
switch f.Name {
case "", ".", "..", "/": // A few obviously invalid filenames
l.Infof("Dropping invalid filename %q from database", f.Name)
batch := new(leveldb.Batch)
ldbRemoveFromGlobal(db, batch, folder, device, nil)
batch.Delete(dbi.Key())