This prevents combining untrusted with introducer and auto-accept, and also verifies that folders shared with untrusted devices have passwords at config loading time. Co-authored-by: Simon Frei <freisim93@gmail.com>
This commit is contained in:
@@ -34,6 +34,19 @@ func (cfg *DeviceConfiguration) prepare(sharedFolders []string) {
|
||||
}
|
||||
|
||||
cfg.IgnoredFolders = sortedObservedFolderSlice(ignoredFolders)
|
||||
|
||||
// A device cannot be simultaneously untrusted and an introducer, nor
|
||||
// auto accept folders.
|
||||
if cfg.Untrusted {
|
||||
if cfg.Introducer {
|
||||
l.Warnf("Device %s (%s) is both untrusted and an introducer, removing introducer flag", cfg.DeviceID.Short(), cfg.Name)
|
||||
cfg.Introducer = false
|
||||
}
|
||||
if cfg.AutoAcceptFolders {
|
||||
l.Warnf("Device %s (%s) is both untrusted and auto-accepting folders, removing auto-accept flag", cfg.DeviceID.Short(), cfg.Name)
|
||||
cfg.AutoAcceptFolders = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (cfg *DeviceConfiguration) IgnoredFolder(folder string) bool {
|
||||
|
||||
Reference in New Issue
Block a user