mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
lib/config: Set DisableTempIndexes to true on receive-encrypted (#7701)
This commit is contained in:
parent
5bdb6798a9
commit
0126188ba7
@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -214,6 +214,7 @@ func (f *FolderConfiguration) prepare(myID protocol.DeviceID, existingDevices ma
|
|||||||
}
|
}
|
||||||
|
|
||||||
if f.Type == FolderTypeReceiveEncrypted {
|
if f.Type == FolderTypeReceiveEncrypted {
|
||||||
|
f.DisableTempIndexes = true
|
||||||
f.IgnorePerms = true
|
f.IgnorePerms = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user