From 746296198028f70081508a2a6b8cf1e244e16190 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 20 Feb 2024 02:23:49 +0100 Subject: [PATCH] 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` --- dnscrypt-proxy/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index 37b00279..3be67581 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -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")