aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-27 11:49:41 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-27 11:49:41 +0000
commitbaaad2f31826c78c9858b19075644998a4ba94d0 (patch)
treecd1c2b94026718b2647c807458e218a44f3fd908 /kiss
parent4ef971c0e4f55ced71a17432705093c09d05fc04 (diff)
downloadcpt-baaad2f31826c78c9858b19075644998a4ba94d0.tar.gz
kiss: don't run as root
FossilOrigin-Name: 22e3e5f5ec1228fbe99e39d09aa34a23f833d3e33a1a415661aa326b5372cc20
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss4
1 files changed, 4 insertions, 0 deletions
diff --git a/kiss b/kiss
index 7d49ca7..8303bae 100755
--- a/kiss
+++ b/kiss
@@ -1139,6 +1139,10 @@ main() {
# from leaking to stdout.
set +x
+ # Prevent the package manager from running as root. The package
+ # manager will elevate permissions where needed.
+ [ "$(id -u)" != 0 ] || die "kiss must be run as a normal user"
+
# Set the location to the repository and package database.
pkg_db=var/db/kiss/installed