aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-22 20:50:06 +0000
committermerakor <cem@ckyln.com>2020-04-22 20:50:06 +0000
commit24386a5dcbfa4ae72aae9b63c355cc2e02f05360 (patch)
tree8ba74735a3f9769ba6d55d383f6cced33a1438b4
parent9cb6c938dfef8979d06ff35c951b469e0bab6320 (diff)
downloadcpt-24386a5dcbfa4ae72aae9b63c355cc2e02f05360.tar.gz
kiss: ensure that the owner actually exists
FossilOrigin-Name: e465e438b47fe464fe8497653aa224e27105bb581f071a48dc23d7ccbdbd09d6
-rwxr-xr-xkiss7
1 files changed, 5 insertions, 2 deletions
diff --git a/kiss b/kiss
index b907659..b1fa228 100755
--- a/kiss
+++ b/kiss
@@ -1166,9 +1166,12 @@ pkg_fetch() {
# 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