diff --git a/cdist/conf/type/__ssh_dot_ssh/explorer/group b/cdist/conf/type/__ssh_dot_ssh/explorer/group index cdea6fe7..faf44cb8 100755 --- a/cdist/conf/type/__ssh_dot_ssh/explorer/group +++ b/cdist/conf/type/__ssh_dot_ssh/explorer/group @@ -1,6 +1,7 @@ #!/bin/sh # # 2014 Steven Armstrong (steven-cdist at armstrong.cc) +# 2019 Dennis Camera (dennis.camera at ssrq-sds-fds.ch) # # This file is part of cdist. # @@ -18,5 +19,11 @@ # along with cdist. If not, see . # -gid="$("$__type_explorer/passwd" | cut -d':' -f 4)" -getent group "$gid" || true +gid=$("$__type_explorer/passwd" | cut -d':' -f4) + +if command -v getent >/dev/null +then + getent group "$gid" || true +else + awk -F: "\$3 == \"$gid\" { print }" /etc/group +fi diff --git a/cdist/conf/type/__ssh_dot_ssh/explorer/passwd b/cdist/conf/type/__ssh_dot_ssh/explorer/passwd index 3fbad06f..42686b20 100755 --- a/cdist/conf/type/__ssh_dot_ssh/explorer/passwd +++ b/cdist/conf/type/__ssh_dot_ssh/explorer/passwd @@ -2,6 +2,7 @@ # # 2012 Steven Armstrong (steven-cdist at armstrong.cc) # 2014 Nico Schottelius (nico-cdist at schottelius.org) +# 2019 Dennis Camera (dennis.camera at ssrq-sds-fds.ch) # # This file is part of cdist. # @@ -21,4 +22,16 @@ owner="$__object_id" -getent passwd "$owner" || true +if command -v getent >/dev/null +then + getent passwd "$owner" || true +else + case $owner in + [0-9][0-9]*) + awk -F: "\$3 == \"$owner\" { print }" /etc/passwd + ;; + *) + grep "^$owner:" /etc/passwd || true + ;; + esac +fi