huit / puppet-ipa

Puppet module that can manage an IPA master, replicas and clients.
15 stars 48 forks source link

shell escaping in flushcache.pp is excessively fancy #8

Closed hakamadare closed 11 years ago

hakamadare commented 11 years ago
Jul 22 15:47:33 puppet puppet-master[6910]: Unrecognised escape sequence '\;' in file /etc/puppet/modules/ipa/manifests/flushcache.pp at line 6

oh noes! this seems to be not particularly serious.

robruma commented 11 years ago

Hmm... This escape is necessary for the find exec argument:

'RedHat' => "/bin/bash -c \"if [ -x /usr/sbin/sss_cache ]; then /usr/sbin/sss_cache -UGN >/dev/null 2>&1 ; else /usr/bin/find /var/lib/sss/db -type f -exec rm -f '{}' \; ; fi\"",

This enables RHEL 5 clients without the sss_cache tool to flush the sss cache...

I'll test with alternative syntax.

Thanks Rob

aellert commented 11 years ago

Hi,

Maybe the puppet function named shellquote should help here ?

Alexandre

robruma commented 11 years ago

Great idea Alexandre!

I've seen the shellquote function but have never used it. I've rewritten the commands in the flushcache.pp manifest to utilize the shellquote function. It seems to have worked...

Please let me know you continue to see this log warning Steve.

Thanks Rob

robruma commented 11 years ago

I did not see any recent occurrences of this log on the Puppet Master. I think this is safe to close.