diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-11-02 17:00:25 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-11-02 17:00:25 +0900 |
| commit | 422d8e00d5b5abad4b57a639822403487520f29a (patch) | |
| tree | 3aa72a6aa3b242e1735a90ed61a7ab9f4ee613f3 | |
| parent | 584732f80ab91afb349720cfb8e9979ed2ba173e (diff) | |
fortify: replace direct syscall with prctl wrapper
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
| -rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2,8 +2,8 @@ package main import ( "flag" - "syscall" + "git.ophivana.moe/security/fortify/internal" "git.ophivana.moe/security/fortify/internal/app" "git.ophivana.moe/security/fortify/internal/fmsg" "git.ophivana.moe/security/fortify/internal/linux" @@ -20,9 +20,9 @@ func init() { var os = new(linux.Std) func main() { - // linux/sched/coredump.h - if _, _, errno := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_DUMPABLE, 0, 0); errno != 0 { - fmsg.Printf("cannot set SUID_DUMP_DISABLE: %s", errno.Error()) + if err := internal.PR_SET_DUMPABLE__SUID_DUMP_DISABLE(); err != nil { + fmsg.Printf("cannot set SUID_DUMP_DISABLE: %s", err) + // not fatal: this program runs as the privileged user } flag.Parse() |
