From 507143ad21a6a896463bcb154891cd0cb9ac4732 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 16 May 2020 08:18:28 +0300 Subject: [PATCH] docs: update --- kiss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kiss b/kiss index ca2b73b..eac597b 100755 --- a/kiss +++ b/kiss @@ -1349,10 +1349,22 @@ pkg_updates() { # ownership of files and directories in the rare # case that the repository is owned by a 3rd user. ( + # Grab the owner of the directory via 'ls -ld'. + # This is fine despite the usual gabble about + # 'ls' and its usage in scripts. + # + # Grabbing permissions, ownership or symlink + # targets from 'ls -l' output is totally fine + # and doesn't suffer from the disconnect + # between the real and display representation + # of the information.. read -r _ _ user _ <<-EOF || user=root $(ls -ld "$PWD") EOF + # If the owner's user ID doesn't exist, fallback + # to using 'root'. This prevents the code from + # changing the permissions to something wonky. id -u "$user" >/dev/null 2>&1 || user=root