aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-30 13:25:46 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-30 13:25:46 +0000
commitdd633006580f525d8bb245ae761226e26ebd5c2a (patch)
treef9babecac765dcf912e6e44b57d93a120b32e5a4
parentba2a49083bdcd21bd5523073a97e413ee3dc5092 (diff)
downloadcpt-dd633006580f525d8bb245ae761226e26ebd5c2a.tar.gz
kiss: Don't spawn sh with sudo/doas
FossilOrigin-Name: 418ca6dc48304a7ed731bb1d01524d43577fac99e070d71ccd034852a6bcb243
-rwxr-xr-xkiss15
1 files changed, 5 insertions, 10 deletions
diff --git a/kiss b/kiss
index 7278a83..912135d 100755
--- a/kiss
+++ b/kiss
@@ -53,13 +53,9 @@ as_root() {
# 'doas' or 'su'. This also handles KISS' environment variables.
log "Using '${su:-su}'"
- # doas requires these environment variables to be set as they
- # aren't brought over from the calling user.
- env="HOME='$HOME' KISS_FORCE='$KISS_FORCE' KISS_PATH='$KISS_PATH'"
-
case $su in
- *sudo) sudo -E sh -c "$*" ;;
- *doas) doas -- sh -c "$env $*" ;;
+ *sudo) sudo -E "$@" ;;
+ *doas) doas -- "$@" ;;
*) su -pc "$* <&3" 3<&0 </dev/tty ;;
esac
}
@@ -1024,13 +1020,12 @@ pkg_updates() {
log "$PWD" "$signed "
if [ -w "$PWD" ]; then
- git fetch
- git merge
+ git pull
else
log "$PWD" "Need root to update"
- as_root 'git fetch && git merge'
+ as_root git pull
fi
}
done
@@ -1264,7 +1259,7 @@ args() {
;;
v|version|-v|--version)
- log kiss 1.1.4
+ log kiss 1.1.5
;;
h|help|-h|--help|'')