From d596986af894749877fb3dcadf90628c9cfa9d13 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Mon, 31 May 2021 09:06:52 +0200 Subject: [PATCH] [type/__pyvenv] Fix group explorer --- cdist/conf/type/__pyvenv/explorer/group | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__pyvenv/explorer/group b/cdist/conf/type/__pyvenv/explorer/group index f31a1cb7..922ce3df 100755 --- a/cdist/conf/type/__pyvenv/explorer/group +++ b/cdist/conf/type/__pyvenv/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 2>&1 + 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