diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-24 20:48:29 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-24 20:48:29 +0000 |
commit | 96407792f733d5fe6fdbbadb5dc9146e3036f9f7 (patch) | |
tree | d36ee3442b1c9cfccf0d292a3437602a379c8cf9 /kiss | |
parent | 5a223373e01d9cbc951524defcb2d95c4ec4a484 (diff) | |
download | cpt-96407792f733d5fe6fdbbadb5dc9146e3036f9f7.tar.gz |
kiss: Fix gpg error with su.
FossilOrigin-Name: 89c9491f6f007aede9320a247d1fcb57ce6c92abc8096a35cb792417e825b820
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -56,9 +56,9 @@ as_root() { [ "$uid" = 0 ] || log "Using '${su:-su}'" case $su in - *sudo) sudo -Eu "${user:-root}" -- "$@" ;; - *doas) doas -u "${user:-root}" -- "$@" ;; - *) su -pc "$* <&3" "${user:-root}" 3<&0 </dev/tty ;; + *sudo) sudo -E -- "$@" ;; + *doas) doas -- "$@" ;; + *) su -pc "$* <&3" 3<&0 </dev/tty ;; esac } @@ -1108,14 +1108,14 @@ pkg_updates() { ( user=$(stat -c %U "$PWD") - [ "$user" = root ] || + [ "${user:=root}" = root ] || log "Dropping permissions to $user for pull" case $su in - su) as_root "git fetch && git merge" ;; + su) "$su" -c "git fetch && git merge" "$user" ;; - *) "$su" git fetch - "$su" git merge + *) "$su" -u "$user" git fetch + "$su" -u "$user" git merge esac ) fi |