From de29fc1b0fbb55cd4eda0b2fca2e8b837ec210b2 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 14 Mar 2018 13:04:14 +0000 Subject: [PATCH] Error when installing AUR packages as root --- install.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.go b/install.go index d4750ecd..f285eb67 100644 --- a/install.go +++ b/install.go @@ -95,6 +95,9 @@ func install(parser *arguments) error { } hasAur := len(dt.Aur) != 0 + if hasAur && 0 == os.Geteuid() { + return fmt.Errorf(red(arrow + " Refusing to install AUR Packages as root, Aborting.")) + } dc, err = getDepCatagories(parser.formatTargets(), dt) if err != nil { return err