aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index b0558c15..9ccdf0bc 100644
--- a/main.go
+++ b/main.go
@@ -38,6 +38,12 @@ func main() {
// shim early exit
shim.Try()
+ // root check
+ if os.Getuid() == 0 {
+ fmt.Println("fortify: this program must not run as root")
+ os.Exit(1)
+ }
+
// version/license/template command early exit
tryVersion()
tryLicense()