diff --git a/cdist/conf/type/__sed/gencode-remote b/cdist/conf/type/__sed/gencode-remote index 836506f0..df929b42 100755 --- a/cdist/conf/type/__sed/gencode-remote +++ b/cdist/conf/type/__sed/gencode-remote @@ -35,8 +35,11 @@ then exit 0 fi +# we can't use -i, because it's not posix, so we fly with tempfile and cp +# and we use cp because we want to preserve destination file's attributes + # shellcheck disable=SC2016 -echo 'tmp="$( mktemp )"' +echo 'tmp="$__object/tempfile"' echo "$sed_cmd -f - '$file' > \"\$tmp\" << EOF"