lib/config: Set DisableTempIndexes to true on receive-encrypted (#7701)

This commit is contained in:
Simon Frei 2021-05-20 22:33:23 +02:00 committed by GitHub
parent 5bdb6798a9
commit 0126188ba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -1343,3 +1343,30 @@ func TestInternalVersioningConfiguration(t *testing.T) {
}
}
}
func TestReceiveEncryptedFolderFixed(t *testing.T) {
cfg := Configuration{
Folders: []FolderConfiguration{
{
ID: "foo",
Path: "testdata",
Type: FolderTypeReceiveEncrypted,
DisableTempIndexes: false,
IgnorePerms: false,
},
},
}
cfg.prepare(device1)
if len(cfg.Folders) != 1 {
t.Fatal("Expected one folder")
}
f := cfg.Folders[0]
if !f.DisableTempIndexes {
t.Error("DisableTempIndexes should be true")
}
if !f.IgnorePerms {
t.Error("IgnorePerms should be true")
}
}

View File

@ -214,6 +214,7 @@ func (f *FolderConfiguration) prepare(myID protocol.DeviceID, existingDevices ma
}
if f.Type == FolderTypeReceiveEncrypted {
f.DisableTempIndexes = true
f.IgnorePerms = true
}
}