From 503a06ed28f743aad47797a0989be735c67b07a6 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Wed, 28 Apr 2021 13:32:10 +0300 Subject: [PATCH] [__git] fix group explorer group name from numberic id wasn't resolved correctly. try to use getent and fallback to reading /etc/group directly. --- cdist/conf/type/__git/explorer/group | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__git/explorer/group b/cdist/conf/type/__git/explorer/group index 1365c60d..ab4396b1 100644 --- a/cdist/conf/type/__git/explorer/group +++ b/cdist/conf/type/__git/explorer/group @@ -14,6 +14,11 @@ then then printf '%u\n' "${group_gid}" else - printf '%s\n' "$(id -u -n "${group_gid}")" + if command -v getent > /dev/null + then + getent group "${group_gid}" | cut -d : -f 1 + else + awk -F: -v gid="${group_gid}" '$3 == gid { print $1 }' /etc/group + fi fi fi