diff --git a/cdist/conf/type/__postfix_master/gencode-remote b/cdist/conf/type/__postfix_master/gencode-remote index a4d6462b..51edc668 100755 --- a/cdist/conf/type/__postfix_master/gencode-remote +++ b/cdist/conf/type/__postfix_master/gencode-remote @@ -42,6 +42,8 @@ remove_entry() { suffix="#/cdist:$__object_name" cat << DONE tmpfile=\$(mktemp ${config}.cdist.XXXXXXXXXX) +# preserve ownership and permissions of existing file +cp -p "$config" "\$tmpfile" awk -v prefix="$prefix" -v suffix="$suffix" ' { if (index(\$0,prefix)) {