fortify/internal/proc/priv/init/early.go
Ophestra b31d055e20
All checks were successful
Build / Create distribution (push) Successful in 1m39s
Test / Run NixOS test (push) Successful in 3m45s
proc/priv/init: early init check
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-18 12:33:33 +09:00

19 lines
321 B
Go

package init0
import (
"os"
"path"
"git.gensokyo.uk/security/fortify/internal/fmsg"
)
// used by the parent process
// TryArgv0 calls [Main] if argv0 indicates the process is started from a file named "init".
func TryArgv0() {
if len(os.Args) > 0 && path.Base(os.Args[0]) == "init" {
Main()
fmsg.Exit(0)
}
}