aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-14 02:48:37 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-14 02:48:37 +0900
commitaaed5080f4dc691c790c195ad070167060a6eec1 (patch)
tree8076930c1e2a53fa9a6c5a0c8ed8d842c4928458 /main.go
parent41a7eb567e5c2bffc206f3876f5f853dfdaf4d5a (diff)
fortify: move PR_SET_DUMPABLE to the beginning of main
This call does need flag values. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index 6f1ab571..d450f694 100644
--- a/main.go
+++ b/main.go
@@ -22,14 +22,14 @@ func init() {
}
func main() {
- flag.Parse()
- verbose.Set(flagVerbose)
-
// linux/sched/coredump.h
if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_DUMPABLE, 0, 0); errno != 0 {
fmt.Printf("fortify: cannot set SUID_DUMP_DISABLE: %s", errno.Error())
}
+ flag.Parse()
+ verbose.Set(flagVerbose)
+
if internal.SdBootedV {
verbose.Println("system booted with systemd as init system")
}