Issue #4588 has been reported by Fraser Scott.

----------------------------------------
Bug #4588: generate() function doesn't seem to be binary safe when used as File 
content
http://projects.puppetlabs.com/issues/4588

Author: Fraser Scott
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 
Keywords: generate binary safe
Branch: 


The generate() function isn't binary safe it would seem.

    13:52 < masterzen> zeroXten: file content is rendered as a string in the 
json catalog without being escaped correctly :(

For example, when using generate() to control keytabs:

        file { "/etc/krb5.keytab":
                mode => 0600,
                owner => "root",
                group => "root",
                require => Class["libkrb5::install"],
                content => generate("keytabgen", $fqdn),
                replace => no,
        }

results in an error:

    err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not render to pson: invalid utf8 byte: '�'

as the keytab file contains binary. In the above case, keytabgen is essentially 
cat'ing a keytab file for the host.

Of course, one could use use source instead of content/generate, but in this 
particular case generate is needed for post processing.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to