Warn if the executable of the service being installed could be overwritten by other system users

Fixes #2579

Until this is handled by `kardianos/service`
This commit is contained in:
Frank Denis 2024-02-20 02:23:49 +01:00
parent 0b559bb54f
commit 7462961980
1 changed files with 3 additions and 0 deletions

View File

@ -93,6 +93,9 @@ func main() {
dlog.Fatal(err)
}
if *svcFlag == "install" {
if fullexecpath, err := os.Executable(); err == nil {
WarnIfMaybeWritableByOtherUsers(fullexecpath)
}
dlog.Notice("Installed as a service. Use `-service start` to start")
} else if *svcFlag == "uninstall" {
dlog.Notice("Service uninstalled")