From 57e27f73cc94ae4cf49faf482b09cf5a300e43d9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 22 Apr 2020 13:50:02 +0300 Subject: [PATCH] kiss: Set permissions for all non dirs --- kiss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kiss b/kiss index f610274..98dc600 100755 --- a/kiss +++ b/kiss @@ -842,6 +842,13 @@ pkg_install_files() { # KISS' method to avoid the whole fakeroot mess. chown -h root:root "$line" + # Preserve permissions by using chmod. This runs after + # chown as chown will reset suid/guid when ownership changes. + # + # This only runs on non-directories as we desire the reset + # behavior mentioned above. + [ -d "$line" ] || chmod "$perms" "$line" + printf '%s %s (%s)\e[K\r' "$3" "$i/$man_tot" "$line" done