cmd/syncthing: Warn when running as a super user (fixes #4123)

UID 0 on Unixes, SYSTEM SID on Windows.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4148
This commit is contained in:
Jakob Borg
2017-05-15 05:42:21 +00:00
parent d25b15263a
commit 1d15b8be9b
3 changed files with 62 additions and 0 deletions

View File

@@ -941,6 +941,10 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
}
}
if isSuperUser() {
l.Warnln("Syncthing should not run as a privileged or system user. Please consider using a normal user account.")
}
events.Default.Log(events.StartupComplete, map[string]string{
"myID": myID.String(),
})