fortify: move PR_SET_DUMPABLE to the beginning of main
This call does need flag values. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
41a7eb567e
commit
aaed5080f4
6
main.go
6
main.go
|
@ -22,14 +22,14 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
|
||||||
verbose.Set(flagVerbose)
|
|
||||||
|
|
||||||
// linux/sched/coredump.h
|
// linux/sched/coredump.h
|
||||||
if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_DUMPABLE, 0, 0); errno != 0 {
|
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())
|
fmt.Printf("fortify: cannot set SUID_DUMP_DISABLE: %s", errno.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flag.Parse()
|
||||||
|
verbose.Set(flagVerbose)
|
||||||
|
|
||||||
if internal.SdBootedV {
|
if internal.SdBootedV {
|
||||||
verbose.Println("system booted with systemd as init system")
|
verbose.Println("system booted with systemd as init system")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue