Check for dumb file permissions on startup
There's nothing special about "-service install". On any system, executables shouldn't be modifiable by other system users, no matter what the executable is and how it's run.
This commit is contained in:
parent
7462961980
commit
093936f7ab
|
@ -66,6 +66,10 @@ func main() {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fullexecpath, err := os.Executable(); err == nil {
|
||||||
|
WarnIfMaybeWritableByOtherUsers(fullexecpath)
|
||||||
|
}
|
||||||
|
|
||||||
app := &App{
|
app := &App{
|
||||||
flags: &flags,
|
flags: &flags,
|
||||||
}
|
}
|
||||||
|
@ -93,9 +97,6 @@ func main() {
|
||||||
dlog.Fatal(err)
|
dlog.Fatal(err)
|
||||||
}
|
}
|
||||||
if *svcFlag == "install" {
|
if *svcFlag == "install" {
|
||||||
if fullexecpath, err := os.Executable(); err == nil {
|
|
||||||
WarnIfMaybeWritableByOtherUsers(fullexecpath)
|
|
||||||
}
|
|
||||||
dlog.Notice("Installed as a service. Use `-service start` to start")
|
dlog.Notice("Installed as a service. Use `-service start` to start")
|
||||||
} else if *svcFlag == "uninstall" {
|
} else if *svcFlag == "uninstall" {
|
||||||
dlog.Notice("Service uninstalled")
|
dlog.Notice("Service uninstalled")
|
||||||
|
|
Loading…
Reference in New Issue