From aaed5080f4dc691c790c195ad070167060a6eec1 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Mon, 14 Oct 2024 02:48:37 +0900 Subject: [PATCH] fortify: move PR_SET_DUMPABLE to the beginning of main This call does need flag values. Signed-off-by: Ophestra Umiker --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6f1ab57..d450f69 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") }