From ce0f779664e5808382134f12904553b30db65c22 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 24 Feb 2014 16:00:12 +0100 Subject: [PATCH] include the owner into the object_id for line Signed-off-by: Nico Schottelius --- cdist/conf/type/__ssh_authorized_keys/manifest | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__ssh_authorized_keys/manifest b/cdist/conf/type/__ssh_authorized_keys/manifest index 01a29c37..313e3b23 100755 --- a/cdist/conf/type/__ssh_authorized_keys/manifest +++ b/cdist/conf/type/__ssh_authorized_keys/manifest @@ -1,6 +1,7 @@ #!/bin/sh # # 2012-2014 Steven Armstrong (steven-cdist at armstrong.cc) +# 2014 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -75,7 +76,11 @@ IFS=$'\n' for key in $(cat "$__object/parameter/key"); do unset IFS raw_key="$(echo "$key" | tr ' ' '\n' | awk '/^ssh-(rsa|dsa)/ {printf $1" ";getline;printf $1}')" - set -- "$(_cksum "$raw_key")" + + cksum_key="$(_cksum "$raw_key")" + line_id="${owner}-${cksum_key}" + + set -- "$line_id" set -- "$@" --file "$file" set -- "$@" --regex ".*$raw_key.*" if [ "$state" = 'present' ]; then