config: fix issues with memory-only config file paths

Fixes #5222
This commit is contained in:
albertony
2021-04-08 17:49:47 +02:00
parent b96ebfc40b
commit 23a0d4a1e6
11 changed files with 119 additions and 89 deletions

View File

@@ -1317,7 +1317,8 @@ type setConfigFile string
// Set a config item into the config file
func (section setConfigFile) Set(key, value string) {
if strings.HasPrefix(string(section), ":") {
Errorf(nil, "Can't save config %q = %q for on the fly backend %q", key, value, section)
Logf(nil, "Can't save config %q = %q for on the fly backend %q", key, value, section)
return
}
Debugf(nil, "Saving config %q = %q in section %q of the config file", key, value, section)
err := ConfigFileSet(string(section), key, value)