lib/model: Use up to date device name, do not provide name to unknown devices (fixes #4164)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4168
This commit is contained in:
@@ -795,7 +795,7 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
|
||||
ldb.ConvertSymlinkTypes()
|
||||
}
|
||||
|
||||
m := model.NewModel(cfg, myID, myDeviceName(cfg), "syncthing", Version, ldb, protectedFiles)
|
||||
m := model.NewModel(cfg, myID, "syncthing", Version, ldb, protectedFiles)
|
||||
|
||||
if t := os.Getenv("STDEADLOCKTIMEOUT"); len(t) > 0 {
|
||||
it, err := strconv.Atoi(t)
|
||||
@@ -964,15 +964,6 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
func myDeviceName(cfg *config.Wrapper) string {
|
||||
devices := cfg.Devices()
|
||||
myName := devices[myID].Name
|
||||
if myName == "" {
|
||||
myName, _ = os.Hostname()
|
||||
}
|
||||
return myName
|
||||
}
|
||||
|
||||
func setupSignalHandling() {
|
||||
// Exit cleanly with "restarting" code on SIGHUP.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user