From 41f7110d7ad59922c0cb90e39c3c3ed87962173e Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Fri, 22 Dec 2017 01:02:20 +0200 Subject: [PATCH] The original user is not detected properly whn multiple users are logged in. This fix gets the first logged in user. --- src/16_cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/16_cleanup.sh b/src/16_cleanup.sh index 7006a23fe..f3dbf088f 100755 --- a/src/16_cleanup.sh +++ b/src/16_cleanup.sh @@ -12,7 +12,7 @@ if [ "$(id -u)" = "0" ] ; then echo "Applying original ownership to all affected files. This may take a while." # Find the original user. Note that this may not always be correct. - ORIG_USER=`who | awk '{print \$1}'` + ORIG_USER=`who | head -n 1 | awk '{print \$1}'` echo "Original user is '$ORIG_USER'." # Apply ownership back to original owner for all affected files.