From 15d279605b3f1d2721286b29183162638330b4cb Mon Sep 17 00:00:00 2001 From: Jaromil Date: Sat, 14 Sep 2019 12:06:13 +0200 Subject: [PATCH] fix getent parsing when fields are emtpy fix #365 --- tomb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tomb b/tomb index fd50b1d..b487377 100755 --- a/tomb +++ b/tomb @@ -1005,8 +1005,8 @@ _gpg_uid() { awk 'BEGIN { FS=":" } /^uid/ { print $10; exit}' } # helpers to retrieve data from passwd using getent -_get_username() { print ${"$(getent passwd ${1})"[(ws@:@)1]} } -_get_home() { print ${"$(getent passwd ${1})"[(ws@:@)6]} } +_get_username() { getent passwd ${1} | awk -F: '{print $1}' } +_get_home() { getent passwd ${1} | awk -F: '{print $6}' } # $1 is the encrypted key contents we are checking is_valid_key() {