From 285b271dee812e955bb3c5de7257941a1228885c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 22 Apr 2020 15:02:28 +0300 Subject: [PATCH] kiss: ensure that the owner actually exists --- kiss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kiss b/kiss index a08edd4..c6cf3a3 100755 --- a/kiss +++ b/kiss @@ -1161,9 +1161,12 @@ pkg_updates() { # ownership of files and directories in the rare # case that the repository is owned by a 3rd user. ( - user=$(stat -c %U "$PWD") + user=$(stat -c %U "$PWD") || user=root - [ "${user:=root}" = root ] || + id -u "$user" >/dev/null 2>&1 || + user=root + + [ "$user" = root ] || log "Dropping permissions to $user for pull" case $su in