Actions
Bug #37741
openIndentation of snippets can cause errors in bash scripts, if heredoc is used in the template
Description
Assume a snippet with a heredoc block, similar to ca_registration
(that has the CA certificate as a heredoc).
If this snippet is used in indented code block, it will cause a syntax error in the bash.
Steps to reproduce:
render the redhat_register
template and observe the ca_registration
snippet block:
if [ -f "$KATELLO_SERVER_CA_CERT" ]; then
cat << EOF-eaebc9a8 > "$KATELLO_SERVER_CA_CERT"
-----BEGIN CERTIFICATE-----
MIIHNzCCBR+gAwIBAgIUFZxXVC1gX8shPBN4T1PoxvyoIqQwDQYJKoZIhvcNAQEL
# snip
-----END CERTIFICATE-----
EOF-eaebc9a8
if [ -f /etc/debian_version ]; then
CA_TRUST_ANCHORS=/usr/local/share/ca-certificates/
Notice the two spaces before the EOF-eaebc9a8
marker. This causes a syntax error in bash, since it expects EOF at the beginning of the line.
Actions