From 312915b4b372862aa6341081d55e85c2bd7f3191 Mon Sep 17 00:00:00 2001 From: Matthieu Crapet Date: Sat, 2 Jan 2021 09:58:34 +0100 Subject: [PATCH] fix potential wrong _USER value "id -u" gives then uid not a the name. https://man7.org/linux/man-pages/man1/id.1.html Signed-off-by: Matthieu Crapet --- tomb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tomb b/tomb index 8a6265c..f7a28b6 100755 --- a/tomb +++ b/tomb @@ -210,7 +210,7 @@ _whoami() { # Set username from UID or environment _USER=$SUDO_USER [[ -z $_USER ]] && { _USER=$USERNAME } - [[ -z $_USER ]] && { _USER=$(id -u) } + [[ -z $_USER ]] && { _USER=$(id -un) } [[ -z $_USER ]] && { _failure "Failing to identify the user who is calling us" }